diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2008-02-03 18:14:39 -0500 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-02-03 18:14:39 -0500 |
commit | 749c1e36d90998043c1988a49894d9ee23e60ec4 (patch) | |
tree | 77c7a650d4057ff52af1c530c9368b3cf41ce070 /IkiWiki/Rcs | |
parent | 855f28e105ad6f552847891790400f0760d9a631 (diff) | |
download | ikiwiki-749c1e36d90998043c1988a49894d9ee23e60ec4.tar ikiwiki-749c1e36d90998043c1988a49894d9ee23e60ec4.tar.gz |
* monotone changes by Brian May:
- On commits, replace "mtn sync" bidirectional with "mtn push" single
direction. No need to pull changes when doing a commit. mtn sync
is still called in rcs_update.
- Support for viewing differences via patches using viewmtn.
Diffstat (limited to 'IkiWiki/Rcs')
-rw-r--r-- | IkiWiki/Rcs/monotone.pm | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/IkiWiki/Rcs/monotone.pm b/IkiWiki/Rcs/monotone.pm index 0ae2c1a32..a6c850f0d 100644 --- a/IkiWiki/Rcs/monotone.pm +++ b/IkiWiki/Rcs/monotone.pm @@ -342,10 +342,10 @@ sub rcs_commit ($$$;$$) { #{{{ return $conflict; } if (defined($config{mtnsync}) && $config{mtnsync}) { - if (system("mtn", "--root=$config{mtnrootdir}", "sync", + if (system("mtn", "--root=$config{mtnrootdir}", "push", "--quiet", "--ticker=none", "--key", $config{mtnkey}) != 0) { - debug("monotone sync failed"); + debug("monotone push failed"); } } @@ -431,10 +431,28 @@ sub rcs_recentchanges ($) { #{{{ my @changed_files = get_changed_files($automator, $rev); my $file; + my ($out, $err) = $automator->call("parents", $rev); + my @parents = ($out =~ m/^($sha1_pattern)$/); + my $parent = $parents[0]; + foreach $file (@changed_files) { - push @pages, { - page => pagename($file), - } if length $file; + next unless length $file; + + if (defined $config{diffurl} and (@parents == 1)) { + my $diffurl=$config{diffurl}; + $diffurl=~s/\[\[r1\]\]/$parent/g; + $diffurl=~s/\[\[r2\]\]/$rev/g; + $diffurl=~s/\[\[file\]\]/$file/g; + push @pages, { + page => pagename($file), + diffurl => $diffurl, + }; + } + else { + push @pages, { + page => pagename($file), + } + } } push @ret, { |