1
0
mirror of https://github.com/git/git.git synced 2024-11-05 22:19:47 +01:00
git/t/t9116-git-svn-log.sh
David D Kilzer 60f3ff1257 git-svn log: include commit log for the smallest revision in a range
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>
2007-11-17 13:28:21 -08:00

63 lines
1.5 KiB
Bash
Executable File

#!/bin/sh
#
# Copyright (c) 2007 Eric Wong
#
test_description='git-svn log tests'
. ./lib-git-svn.sh
test_expect_success 'setup repository and import' "
mkdir import &&
cd import &&
for i in trunk branches/a branches/b \
tags/0.1 tags/0.2 tags/0.3; do
mkdir -p \$i && \
echo hello >> \$i/README || exit 1
done && \
svn import -m test . $svnrepo
cd .. &&
git-svn init $svnrepo -T trunk -b branches -t tags &&
git-svn fetch &&
git reset --hard trunk &&
echo bye >> README &&
git commit -a -m bye &&
git svn dcommit &&
git reset --hard a &&
echo why >> FEEDME &&
git update-index --add FEEDME &&
git commit -m feedme &&
git svn dcommit &&
git reset --hard trunk &&
echo aye >> README &&
git commit -a -m aye &&
git svn dcommit
"
test_expect_success 'run log' "
git reset --hard a &&
git svn log -r2 trunk | grep ^r2 &&
git svn log -r4 trunk | grep ^r4 &&
git svn log -r3 | grep ^r3
"
test_expect_success 'run log against a from trunk' "
git reset --hard trunk &&
git svn log -r3 a | grep ^r3
"
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-r1-r2-r4 -
"
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-r1 -
"
test_done