]> sipb.mit.edu Git - ikiwiki.git/commitdiff
monotone: Fix recentchanges page when the srcdir is not at the top of the monotone...
authorJoey Hess <joey@kitenet.net>
Tue, 12 Oct 2010 00:30:14 +0000 (20:30 -0400)
committerJoey Hess <joey@kitenet.net>
Tue, 12 Oct 2010 00:30:14 +0000 (20:30 -0400)
IkiWiki/Plugin/monotone.pm
debian/changelog
doc/bugs/monotone_backend_does_not_support_srcdir_in_subdir.mdwn

index 95fbcee7648c56c0825d714d15ad7bea37e93621..75bf2f458a48e461eadb91c44ffb9d21e89260c4 100644 (file)
@@ -252,9 +252,20 @@ sub get_changed_files ($$) {
 
        my @ret;
        my %seen = ();
-       
+
+       # we need to strip off the relative path to the source dir
+       # because monotone outputs all file paths absolute according
+       # to the workspace root
+       my $rel_src_dir = $config{'srcdir'};
+       $rel_src_dir =~ s/^\Q$config{'mtnrootdir'}\E\/?//;
+       $rel_src_dir .= "/" if length $rel_src_dir;
+
        while ($changes =~ m/\s*(add_file|patch|delete|rename)\s"(.*?)(?<!\\)"\n/sg) {
                my $file = $2;
+               # ignore all file changes outside the source dir
+               next unless $file =~ m/^\Q$rel_src_dir\E/;
+               $file =~ s/^\Q$rel_src_dir\E//;
+        
                # don't add the same file multiple times
                if (! $seen{$file}) {
                        push @ret, $file;
index 6d333a8438fbff96ad106d53fd611480b00798f0..12cc90b117ff3091ca774760547acc2171e2fed2 100644 (file)
@@ -12,6 +12,8 @@ ikiwiki (3.20100927) UNRELEASED; urgency=low
   * actiontabs: More consistent styling of Hn tags.
   * websetup: Fix saving of advanced mode changes.
   * websetup: Fix defaults of checkboxes in advanced mode.
+  * monotone: Fix recentchanges page when the srcdir is not at the top
+    of the monotone workspace. Thanks, tommyd.
 
  -- Joey Hess <joeyh@debian.org>  Wed, 29 Sep 2010 11:58:23 -0400
 
index 9e1924472c6f2332a37792fa3c55a606f15798b6..35f624f78bd6b84d40c337e3acd35fec67e0834c 100644 (file)
@@ -1,3 +1,5 @@
 The [[rcs/monotone]] backend does not currently support putting the ikiwiki srcdir
 in a subdirectory of the repository.  It must be at the top. Git has
 special code to handle this case. --[[Joey]] 
+
+[[done]]