From 7080a778ab5d561d0fe2d087d7110c14e0432738 Mon Sep 17 00:00:00 2001 From: mhagger Date: Sun, 9 Jan 2011 06:45:39 +0000 Subject: [PATCH] Test case for grafting onto a parent that was itself grafted. Test repository by: Anders Pilegaard Test case by: me Branch b3's preferred parent is b1 and b1's preferred parent is b2. Since b1 is grafted to b2 first, b1 is not found when b3's preferred parent is sought. This results in a non-optimal creation of branch b3 via a copy from trunk followed by a copy of file2 from b1. git-svn-id: http://cvs2svn.tigris.org/svn/cvs2svn/trunk@5313 be7e6eca-30d4-0310-a8e5-ac0d63af7087 --- run-tests.py | 35 ++++++++++++++++++++++++++ test-data/move-parent-cvsrepos/file1,v | 46 ++++++++++++++++++++++++++++++++++ test-data/move-parent-cvsrepos/file2,v | 28 +++++++++++++++++++++ 3 files changed, 109 insertions(+) create mode 100644 test-data/move-parent-cvsrepos/file1,v create mode 100644 test-data/move-parent-cvsrepos/file2,v diff --git a/run-tests.py b/run-tests.py index d8ed552c..b1752a4d 100755 --- a/run-tests.py +++ b/run-tests.py @@ -3888,6 +3888,40 @@ def strange_default_branch(): ) +@Cvs2SvnTestFunction +def move_parent(): + "graft onto preferred parent that was itself moved" + + conv = ensure_conversion( + 'move-parent', + ) + conv.logs[2].check('first', ( + ('/%(trunk)s/file1', 'A'), + ('/%(trunk)s/file2', 'A'), + )) + conv.logs[3].check('This commit was manufactured', ( + ('/%(branches)s/b2 (from /%(trunk)s:2)', 'A'), + )) + conv.logs[4].check('second', ( + ('/%(branches)s/b2/file1', 'M'), + )) + conv.logs[5].check('This commit was manufactured', ( + ('/%(branches)s/b1 (from /%(branches)s/b2:4)', 'A'), + )) + + # b2 and b1 are equally good parents for b3, so accept either one. + # (Currently, cvs2svn chooses b1 as the preferred parent because it + # comes earlier than b2 in alphabetical order.) + try: + conv.logs[6].check('This commit was manufactured', ( + ('/%(branches)s/b3 (from /%(branches)s/b1:5)', 'A'), + )) + except Failure: + conv.logs[6].check('This commit was manufactured', ( + ('/%(branches)s/b3 (from /%(branches)s/b2:4)', 'A'), + )) + + ######################################################################## # Run the tests @@ -4097,6 +4131,7 @@ test_list = [ add_on_branch2, XFail(branch_from_vendor_branch), strange_default_branch, + XFail(move_parent), ] if __name__ == '__main__': diff --git a/test-data/move-parent-cvsrepos/file1,v b/test-data/move-parent-cvsrepos/file1,v new file mode 100644 index 00000000..524d6747 --- /dev/null +++ b/test-data/move-parent-cvsrepos/file1,v @@ -0,0 +1,46 @@ +head 1.1; +access; +symbols + b3:1.1.2.1.0.4 + b1:1.1.2.1.0.2 + b2:1.1.0.2; +locks; strict; +comment @# @; + + +1.1 +date 2011.01.03.14.26.48; author pilegand; state Exp; +branches + 1.1.2.1; +next ; +commitid 657b4d21dca84567; + +1.1.2.1 +date 2011.01.03.14.26.51; author pilegand; state Exp; +branches; +next ; +commitid 657f4d21dcab4567; + + +desc +@@ + + +1.1 +log +@first +@ +text +@file1 +@ + + +1.1.2.1 +log +@second +@ +text +@a1 1 +On b2 +@ + diff --git a/test-data/move-parent-cvsrepos/file2,v b/test-data/move-parent-cvsrepos/file2,v new file mode 100644 index 00000000..9ce6246a --- /dev/null +++ b/test-data/move-parent-cvsrepos/file2,v @@ -0,0 +1,28 @@ +head 1.1; +access; +symbols + b3:1.1.0.6 + b1:1.1.0.4 + b2:1.1.0.2; +locks; strict; +comment @# @; + + +1.1 +date 2011.01.03.14.26.48; author pilegand; state Exp; +branches; +next ; +commitid 657b4d21dca84567; + + +desc +@@ + + +1.1 +log +@first +@ +text +@file2 +@ -- 2.11.4.GIT