summaryrefslogtreecommitdiff
path: root/t/t9600-cvsimport.sh
diff options
context:
space:
mode:
authorAaron Crane <git@aaroncrane.co.uk>2010-02-06 18:26:24 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-02-06 19:01:59 (GMT)
commit0455ec0330fd29146d6e16189cc9262566cc566d (patch)
tree5bced05300f755cdfde6a33d5751d7ea5a51197c /t/t9600-cvsimport.sh
parentb0883aa6c77111e88496bd0afe073caf68ab9f99 (diff)
downloadgit-0455ec0330fd29146d6e16189cc9262566cc566d.zip
git-0455ec0330fd29146d6e16189cc9262566cc566d.tar.gz
git-0455ec0330fd29146d6e16189cc9262566cc566d.tar.bz2
cvsimport: new -R option: generate .git/cvs-revisions mapping
This option causes the creation or updating of a file mapping CVS (filename, revision number) pairs to Git commit IDs. This is expected to be useful if you have CVS revision numbers stored in commit messages, bug-tracking systems, email archives, and the like. Signed-off-by: Aaron Crane <git@aaroncrane.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9600-cvsimport.sh')
-rwxr-xr-xt/t9600-cvsimport.sh36
1 files changed, 33 insertions, 3 deletions
diff --git a/t/t9600-cvsimport.sh b/t/t9600-cvsimport.sh
index 363345f..b572ce3 100755
--- a/t/t9600-cvsimport.sh
+++ b/t/t9600-cvsimport.sh
@@ -47,13 +47,20 @@ EOF
test_expect_success 'import a trivial module' '
- git cvsimport -a -z 0 -C module-git module &&
+ git cvsimport -a -R -z 0 -C module-git module &&
test_cmp module-cvs/o_fortuna module-git/o_fortuna
'
test_expect_success 'pack refs' 'cd module-git && git gc && cd ..'
+test_expect_success 'initial import has correct .git/cvs-revisions' '
+
+ (cd module-git &&
+ git log --format="o_fortuna 1.1 %H" -1) > expected &&
+ test_cmp expected module-git/.git/cvs-revisions
+'
+
test_expect_success 'update cvs module' '
cd module-cvs &&
@@ -86,13 +93,21 @@ EOF
test_expect_success 'update git module' '
cd module-git &&
- git cvsimport -a -z 0 module &&
+ git cvsimport -a -R -z 0 module &&
git merge origin &&
cd .. &&
test_cmp module-cvs/o_fortuna module-git/o_fortuna
'
+test_expect_success 'update has correct .git/cvs-revisions' '
+
+ (cd module-git &&
+ git log --format="o_fortuna 1.1 %H" -1 HEAD^ &&
+ git log --format="o_fortuna 1.2 %H" -1 HEAD) > expected &&
+ test_cmp expected module-git/.git/cvs-revisions
+'
+
test_expect_success 'update cvs module' '
cd module-cvs &&
@@ -107,13 +122,22 @@ test_expect_success 'cvsimport.module config works' '
cd module-git &&
git config cvsimport.module module &&
- git cvsimport -a -z0 &&
+ git cvsimport -a -R -z0 &&
git merge origin &&
cd .. &&
test_cmp module-cvs/tick module-git/tick
'
+test_expect_success 'second update has correct .git/cvs-revisions' '
+
+ (cd module-git &&
+ git log --format="o_fortuna 1.1 %H" -1 HEAD^^ &&
+ git log --format="o_fortuna 1.2 %H" -1 HEAD^
+ git log --format="tick 1.1 %H" -1 HEAD) > expected &&
+ test_cmp expected module-git/.git/cvs-revisions
+'
+
test_expect_success 'import from a CVS working tree' '
$CVS co -d import-from-wt module &&
@@ -126,6 +150,12 @@ test_expect_success 'import from a CVS working tree' '
'
+test_expect_success 'no .git/cvs-revisions created by default' '
+
+ ! test -e import-from-wt/.git/cvs-revisions
+
+'
+
test_expect_success 'test entire HEAD' 'test_cmp_branch_tree master'
test_done