]> sipb.mit.edu Git - ikiwiki.git/blobdiff - doc/todo/darcs.mdwn
add combined/extended darcs plugin
[ikiwiki.git] / doc / todo / darcs.mdwn
index 83ffc6991cd6e6094570592177b02324041fa154..512a7ba0ad60cfa44368b5412d2b63fb996aa232 100644 (file)
@@ -9,8 +9,8 @@ Here's Thomas Schwinge unfinished darcs support for ikiwiki.
 
 -- [Thomas Schwinge](mailto:tschwinge@gnu.org)
 
-[[toggle text="show"]]
-[[toggleable text="""
+[[!toggle text="show"]]
+[[!toggleable text="""
        # Support for the darcs rcs, <URL:http://darcs.net/>.
        # Copyright (C) 2006  Thomas Schwinge <tschwinge@gnu.org>
        #
@@ -206,8 +206,8 @@ This is my ([bma](bma@bmalee.eu)) darcs.pm - it's messy (my Perl isn't up to muc
 
 `rcs_commit()` uses backticks instead of `system()`, to prevent darcs' output being sent to the browser and mucking with the HTTP headers (`darcs record` has no --quiet option). And `rcs_recentchanges()` uses regexes rather than parsing darcs' XML output.
 
-[[toggle text="show" id="bma"]]
-[[toggleable id="bma" text="""
+[[!toggle text="show" id="bma"]]
+[[!toggleable id="bma" text="""
 
        #!/usr/bin/perl
        
@@ -334,8 +334,8 @@ This is my ([bma](bma@bmalee.eu)) darcs.pm - it's messy (my Perl isn't up to muc
 
 Well, here's my version too. It only does getctime -- using a real XML parser, instead of regexp ugliness -- and maybe recentchanges, but that may be bitrotted, or maybe I never finished it, as I only need the getctime. As for actual commits, I have previously voiced my opinion, that this should be done by the plugin generating a patch bundle, and forwarding it to darcs in some way (`darcs apply` or even email to another host, possibly moderated), instead of the hacky direct modification of a working copy. It could also be faster to getctime in a batch. Just reading in all the changes the first time they're needed, might not be a big improvement in many cases, but if we got a batch request from ikiwiki, we could keep reaing the changes until all the files in this batch request have been met.  --[[tuomov]]
 
-[[toggle text="show" id="tuomov"]]
-[[toggleable id="tuomov" text="""
+[[!toggle text="show" id="tuomov"]]
+[[!toggleable id="tuomov" text="""
 <pre>
 #!/usr/bin/perl
 # Stubs for no revision control.
@@ -468,5 +468,42 @@ sub rcs_getctime ($) {
 I merged the two versions above and made some fixes; it is recording my web edits in darcs and showing a recent changes page.
 It is in a [darcs repository](http://joyful.com/darcsweb/darcsweb.cgi?r=ikiwiki-darcs), please send patches. --[[Simon_Michael]]
 
+> I'd like to see at least the following fixed before I commit this: --[[Joey]]
+> * Running `darcs record $filename` in backticks is not good (security)
+>   The thing to do is to open stdout to /dev/null before execing darcs.
+> * Get `rcs_recentchanges_xml` working, parsing xml with regexps does
+>   not seem like a maintenance win.
+> * `rcs_notify` should be removed, it's no longer used.
+> * Some form of conflict handling. Using darcs to attempt to merge
+>   the changes is I gusss optional (although every other rcs backend,
+>   including svn manages to do this), but it needs to at *least* detect
+>   conflicts and return a page with conflict markers for the user to fix
+>   the conflict.
 
-[[tag patch]]
+I have addressed the recentchanges bit, you can find my hacked up darcs.pm at <http://web.mornfall.net/stuff/web-root/IkiWiki/Rcs/darcs.pm>.
+
+It's got couple of FIXMEs, and a very site-specific filter for recentchanges. Not sure how to do that better though. I will eventually add web commits, probably of my own (and mention it here).
+
+---
+
+And here's yet another one. :)
+
+<http://khjk.org/~pesco/ikiwiki-darcs/>
+
+I've taken all the good stuff from the above and added the missing hooks. Some of them I haven't had a chance to test, namely `rcs_rename`, `rcs_remove`, `rcs_commit_staged`, and `rcs_diff`. Also, I'm not experienced with perl and don't know where I should have used the function `possibly_foolish_untaint`.
+
+Regarding the repository layout: There are two darcs repositories. One is the `srcdir`, the other we'll call `master`.
+
+ *  HTML is generated from `srcdir`.
+ *  CGI edits happen in `srcdir`.
+ *  The backend pulls updates from `master` into `srcdir`, i.e. darcs commits should happen to `master`.
+ *  `master` calls ikiwiki (through a wrapper) in its apply posthook, i.e. `master/_darcs/prefs/defaults` should look like this:
+
+        apply posthook ikiwrap
+        apply run-posthook
+
+    (I'm not sure, should/could it be `ikiwrap --refresh` above?)
+ *  The backend pushes CGI edits from `srcdir` back into `master` (triggering the apply hook).
+ *  The working copies in `srcdir` and `master` should *not* be touched by the user, only by the CGI or darcs, respectively.
+
+[[!tag patch]]