From 257e241308b662971c20757a0bac90d4d18e2b7a Mon Sep 17 00:00:00 2001 From: mhagger Date: Sat, 29 Jan 2011 05:22:12 +0000 Subject: [PATCH] Solve the move_parents problem. Graft a branch before its possible parents, to avoid the possibility that the parent is grafted away and then cannot be identified as a possible parent. This patch is inspired by a patch submitted by Anders Pilegaard . git-svn-id: http://cvs2svn.tigris.org/svn/cvs2svn/trunk@5319 be7e6eca-30d4-0310-a8e5-ac0d63af7087 --- cvs2svn_lib/cvs_file_items.py | 6 +++++- run-tests.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cvs2svn_lib/cvs_file_items.py b/cvs2svn_lib/cvs_file_items.py index 5e24109e..d339047b 100644 --- a/cvs2svn_lib/cvs_file_items.py +++ b/cvs2svn_lib/cvs_file_items.py @@ -1037,7 +1037,11 @@ class CVSFileItems(object): for cvs_tag in lod_items.cvs_tags: self._adjust_tag_parent(cvs_tag) - for cvs_branch in lod_items.cvs_branches: + # It is important to process branches in reverse order, so that + # a branch graft target (which necessarily occurs earlier in the + # list than the branch itself) is not moved before the branch + # itself. + for cvs_branch in reversed(lod_items.cvs_branches): self._adjust_branch_parents(cvs_branch) def _get_revision_source(self, cvs_symbol): diff --git a/run-tests.py b/run-tests.py index b1752a4d..e2fad54f 100755 --- a/run-tests.py +++ b/run-tests.py @@ -4131,7 +4131,7 @@ test_list = [ add_on_branch2, XFail(branch_from_vendor_branch), strange_default_branch, - XFail(move_parent), + move_parent, ] if __name__ == '__main__': -- 2.11.4.GIT