}
sub rcs_diff ($;$) {
- # TODO
+ my $rev=shift;
+ my $maxlines=shift;
+ my @lines;
+ my $addlines=sub {
+ my $line=shift;
+ return if defined $maxlines && @lines == $maxlines;
+ push @lines, $line."\n"
+ if (@lines || $line=~/^diff --git/);
+ return 1;
+ };
+ safe_hg(undef, $addlines, "hg", "diff", "-c", $rev, "-g");
+ if (wantarray) {
+ return @lines;
+ }
+ else {
+ return join("", @lines);
+ }
}
{
ikiwiki (3.20110716) UNRELEASED; urgency=low
- * mercurial: openid nicknames are now used when committing. (Daniel Andersson)
- * mercurial: implement rcs_commit_staged so comments, attachments, etc
+ * mercurial: Openid nicknames are now used when committing. (Daniel Andersson)
+ * mercurial: Implement rcs_commit_staged so comments, attachments, etc
can be used. (Daniel Andersson)
- * mercurial: implement rcs_rename and rcs_remove. (Daniel Andersson)
- * mercurial: fix viewing of a diff containing non-utf8 changes.
+ * mercurial: Implement rcs_rename, rcs_remove. (Daniel Andersson)
+ * mercurial: Fix viewing of a diff containing non-utf8 changes.
(Daniel Andersson)
* mercurial: Make both rcs_getctime and rcs_getmtime fast. (Daniel Andersson)
+ * mercurial: Implement rcs_diff. (Daniel Andersson)
-- Joey Hess <joeyh@debian.org> Tue, 19 Jul 2011 11:22:52 -0400
`rcs_commit_staged` |yes |yes |yes |yes |yes |yes |no |yes
`rcs_rename` |yes |yes |yes |yes |yes |yes |no |yes
`rcs_remove` |yes |yes |yes |yes |yes |yes |no |yes
-`rcs_diff` |yes |yes |yes |yes |no |yes |yes |yes
+`rcs_diff` |yes |yes |yes |yes |yes |yes |yes |yes
`rcs_getctime` |fast |slow |slow |slow |fast |slow |slow |slow
`rcs_getmtime` |fast |slow |slow |slow |fast |no |no |no
`rcs_preprevert` |yes |no |no |no |no |no |no |no