summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fede44b)
raw | patch | inline | side by side (parent: fede44b)
author | David D Kilzer <ddkilzer@kilzer.net> | |
Sun, 11 Nov 2007 06:10:34 +0000 (22:10 -0800) | ||
committer | Eric Wong <normalperson@yhbt.net> | |
Sat, 17 Nov 2007 21:28:21 +0000 (13:28 -0800) |
The "svn log -rM:N" command shows commit logs inclusive in the range [M,N].
Previously "git-svn log" always excluded the commit log for the smallest
revision in a range, whether the range was ascending or descending. With
this patch, the smallest revision in a range is always shown.
Updated tests for ascending and descending revision ranges.
Signed-off-by: David D Kilzer <ddkilzer@kilzer.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
Previously "git-svn log" always excluded the commit log for the smallest
revision in a range, whether the range was ascending or descending. With
this patch, the smallest revision in a range is always shown.
Updated tests for ascending and descending revision ranges.
Signed-off-by: David D Kilzer <ddkilzer@kilzer.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
git-svn.perl | patch | blob | history | |
t/t9116-git-svn-log.sh | patch | blob | history |
diff --git a/git-svn.perl b/git-svn.perl
index 1872214dec51f7b6afd6e8ea2f441d8bd3bf4ef6..506e1a605d75579a05ccb91bc8de8d357308e4a5 100755 (executable)
--- a/git-svn.perl
+++ b/git-svn.perl
$c_min = $gs->rev_db_get($r_min);
if (defined $c_min && defined $c_max) {
if ($r_max > $r_min) {
- push @cmd, "$c_min..$c_max";
+ push @cmd, "--boundary", "$c_min..$c_max";
} else {
- push @cmd, "$c_max..$c_min";
+ push @cmd, "--boundary", "$c_max..$c_min";
}
} elsif ($r_max > $r_min) {
push @cmd, $c_max;
my (@k, $c, $d, $stat);
my $esc_color = qr/(?:\033\[(?:(?:\d+;)*\d*)?m)*/;
while (<$log>) {
- if (/^${esc_color}commit ($::sha1_short)/o) {
+ if (/^${esc_color}commit -?($::sha1_short)/o) {
my $cmt = $1;
if ($c && cmt_showable($c) && $c->{r} != $r_last) {
$r_last = $c->{r};
diff --git a/t/t9116-git-svn-log.sh b/t/t9116-git-svn-log.sh
index 618d7e9c003cc5dc1b56f6338a7c4738cc7b00f5..500089208da25da3c0c1c695be33a17ca61f6ebe 100755 (executable)
--- a/t/t9116-git-svn-log.sh
+++ b/t/t9116-git-svn-log.sh
git svn log -r3 a | grep ^r3
"
-printf 'r2 \nr4 \n' > expected-range-r2-r4
+printf 'r1 \nr2 \nr4 \n' > expected-range-r1-r2-r4
test_expect_success 'test ascending revision range' "
git reset --hard trunk &&
- git svn log -r 1:4 | grep '^r[0-9]' | cut -d'|' -f1 | diff -u expected-range-r2-r4 -
+ git svn log -r 1:4 | grep '^r[0-9]' | cut -d'|' -f1 | diff -u expected-range-r1-r2-r4 -
"
-printf 'r4 \nr2 \n' > expected-range-r4-r2
+printf 'r4 \nr2 \nr1 \n' > expected-range-r4-r2-r1
test_expect_success 'test descending revision range' "
git reset --hard trunk &&
- git svn log -r 4:1 | grep '^r[0-9]' | cut -d'|' -f1 | diff -u expected-range-r4-r2 -
+ git svn log -r 4:1 | grep '^r[0-9]' | cut -d'|' -f1 | diff -u expected-range-r4-r2-r1 -
"
test_done