Skip to content

Commit

Permalink
git-svn log: fix ascending revision ranges
Browse files Browse the repository at this point in the history
Fixed typo in Git::SVN::Log::git_svn_log_cmd().  Previously a command like
"git-svn log -r1:4" would only show a commit log separator.

Added tests for ascending and descending revision ranges.

Signed-off-by: David D Kilzer <ddkilzer@kilzer.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
  • Loading branch information
David D Kilzer authored and Eric Wong committed Nov 17, 2007
1 parent 3caf320 commit fede44b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion git-svn.perl
Original file line number Diff line number Diff line change
Expand Up @@ -3798,7 +3798,7 @@ sub git_svn_log_cmd {
$c_max = $gs->rev_db_get($r_max);
$c_min = $gs->rev_db_get($r_min);
if (defined $c_min && defined $c_max) {
if ($r_max > $r_max) {
if ($r_max > $r_min) {
push @cmd, "$c_min..$c_max";
} else {
push @cmd, "$c_max..$c_min";
Expand Down
14 changes: 14 additions & 0 deletions t/t9116-git-svn-log.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,18 @@ test_expect_success 'run log against a from trunk' "
git svn log -r3 a | grep ^r3
"

printf 'r2 \nr4 \n' > expected-range-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 -
"

printf 'r4 \nr2 \n' > expected-range-r4-r2

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 -
"

test_done

0 comments on commit fede44b

Please sign in to comment.