I think the attached patch fixes the problem. It seems
to work for me, both with current and pristine.

> A simple way to "fix" it is to rename
> _darcs/pristine to _darcs/current.

So I take it there's no actual difference between the
two formats...

> The correct fix is of course that darcs.cgi should
> be updated to
> look for both current and pristine, hopefully before
> 1.0.9.

Right :) This is an unfortunate inconsistency in
1.0.8, and not an obvious one at that, as darcs.cgi
still generates a repo view page. But when choosing
"annotate", the script complains about a missing file
(perversely, that missing name is actually wrong -- it
has a space character in the beginning, leading one to
potentially look for the problem elsewhere).

-- Dan


 
____________________________________________________________________________________
Want to start your own business? Learn how on Yahoo! Small Business 
(http://smallbusiness.yahoo.com) 
--- /var/www/cgi-bin/darcs.cgi  2006-06-24 11:43:28.000000000 +0300
+++ /var/www/cgi-bin/darcs2.cgi 2006-11-02 00:20:05.000000000 +0200
@@ -125,6 +125,15 @@
     return $pipe;
 }
 
+sub pristine_dir {
+    my ($repo) = @_;
+    my $pristine = "current";
+    if (! -d "${repository_root}/${repo}/_darcs/$pristine") {
+        $pristine = "pristine";
+    }
+    return "${repository_root}/${repo}/_darcs/$pristine";
+}
+
 # begin an XML document with a root element and the repository path
 sub make_xml {
     my ($fh, $repo, $dir, $file) = @_;
@@ -203,7 +212,7 @@
     make_xml($fh, $repo, $dir, '');
 
     print $fh "<files>\n";
-    my $dir_ = "$repository_root/$repo/_darcs/current/$dir";
+    my $dir_ = pristine_dir ($repo) . "/$dir";
     opendir(DH, $dir_);
     while( defined (my $file_ = readdir(DH)) ) {
         next if $file_ =~ /^\.\.?$/;
@@ -384,7 +393,7 @@
             }
             $file = $bits[$#bits];
             # check if last element of path, stored in $file, is really a dir
-            if (-d "${repository_root}/${repo}/_darcs/current/${dir}/${file}") 
{
+            if (-d (pristine_dir ($repo) . "/${dir}/${file}")) {
                 $dir = ($dir ? "$dir/$file" : $file);
                 $file = '';
             }
@@ -403,7 +412,7 @@
 
     # don't generate output unless the requested path has been
     # modified since the client last saw it.
-    return if is_cached("$repository_root/$repo/_darcs/current/$dir/$file");
+    return if is_cached(pristine_dir ($repo) . "/$dir/$file");
 
     # untaint patches and tags. Tags can have arbitrary values, so
     # never pass these unquoted, on pain of pain!
_______________________________________________
darcs-users mailing list
[email protected]
http://www.abridgegame.org/mailman/listinfo/darcs-users

Reply via email to