diff options
author | intrigeri <intrigeri@boum.org> | 2010-12-20 14:27:21 +0100 |
---|---|---|
committer | intrigeri <intrigeri@boum.org> | 2010-12-20 14:27:21 +0100 |
commit | 75196e76b627709a6ecae3fa948e1fba7928a5ce (patch) | |
tree | 6aa2baeb9cc68f98ca256ce0ff5cb20909f52ef9 /IkiWiki/Plugin/monotone.pm | |
parent | 8c2962ec48ae57605d6d0e297be437a97b6229ca (diff) | |
parent | e5ed3c9e3801360cc00ce4f4f325f68ac0770bff (diff) |
Merge remote branch 'upstream/master' into prv/po
Diffstat (limited to 'IkiWiki/Plugin/monotone.pm')
-rw-r--r-- | IkiWiki/Plugin/monotone.pm | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/monotone.pm b/IkiWiki/Plugin/monotone.pm index 95fbcee76..75bf2f458 100644 --- a/IkiWiki/Plugin/monotone.pm +++ b/IkiWiki/Plugin/monotone.pm @@ -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; |