From 50904604c7c67ef19ae931f3a3e64ba9e97a30d8 Mon Sep 17 00:00:00 2001 From: mhagger Date: Sat, 22 Aug 2009 12:28:53 +0000 Subject: [PATCH] Allow the names of unlabeled branches to be transformed using SymbolTransforms. * cvs2svn_lib/collect_data.py (_SymbolDataCollector._add_unlabeled_branch): Run the unlabeled branch name through the SymbolTransforms. * run-tests.py (transform_unlabeled_branch_name): New test case. (test_list): Add new test case. * test-data/unlabeled-branch-cvsrepos: CVS repository for new test case. * CHANGES: Document change. git-svn-id: http://cvs2svn.tigris.org/svn/cvs2svn/trunk@4886 be7e6eca-30d4-0310-a8e5-ac0d63af7087 --- CHANGES | 1 + cvs2svn_lib/collect_data.py | 3 +- run-tests.py | 13 +++++ test-data/unlabeled-branch-cvsrepos/CVSROOT/README | 8 +++ test-data/unlabeled-branch-cvsrepos/proj/a.txt,v | 60 ++++++++++++++++++++++ 5 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 test-data/unlabeled-branch-cvsrepos/CVSROOT/README create mode 100644 test-data/unlabeled-branch-cvsrepos/proj/a.txt,v diff --git a/CHANGES b/CHANGES index b85cbe70..6bc978c1 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,7 @@ Version ?.?.? (not yet released) * Generate manual pages automatically via new --man option. * Allow --mime-types and --auto-props options to be specified more than once. * Support author transforms when converting to Subversion. + * Allow unlabeled branches to be renamed using SymbolTransforms. Bugs fixed: * cvs2git with non-inline blobs: a revision after a delete could be empty. diff --git a/cvs2svn_lib/collect_data.py b/cvs2svn_lib/collect_data.py index 036e8c6b..16989faa 100644 --- a/cvs2svn_lib/collect_data.py +++ b/cvs2svn_lib/collect_data.py @@ -310,7 +310,8 @@ class _SymbolDataCollector(object): return branch_data def _add_unlabeled_branch(self, branch_number): - name = "unlabeled-" + branch_number + original_name = "unlabeled-" + branch_number + name = self.transform_symbol(original_name, branch_number) return self._add_branch(name, branch_number) def _add_tag(self, name, revision): diff --git a/run-tests.py b/run-tests.py index ef8a52f5..286ed9b4 100755 --- a/run-tests.py +++ b/run-tests.py @@ -3630,6 +3630,18 @@ def missing_deltatext(): ) +@Cvs2SvnTestFunction +def transform_unlabeled_branch_name(): + "transform name of unlabeled branch" + + conv = ensure_conversion( + 'unlabeled-branch', + args=[ + '--symbol-transform=unlabeled-1.1.4:BRANCH2', + ], + ) + + ######################################################################## # Run the tests @@ -3824,6 +3836,7 @@ test_list = [ # 160: XFail(add_cvsignore_to_branch_test), missing_deltatext, + transform_unlabeled_branch_name, ] if __name__ == '__main__': diff --git a/test-data/unlabeled-branch-cvsrepos/CVSROOT/README b/test-data/unlabeled-branch-cvsrepos/CVSROOT/README new file mode 100644 index 00000000..56112b31 --- /dev/null +++ b/test-data/unlabeled-branch-cvsrepos/CVSROOT/README @@ -0,0 +1,8 @@ +This CVSROOT/ directory is only here to convince CVS that this is a +real repository. Without it, CVS operations fail with an error like: + + cvs [checkout aborted]: .../main-cvsrepos/CVSROOT: No such file or directory + +Of course, CVS doesn't seem to require that there actually be any +files in CVSROOT/, which kind of makes one wonder why it cares about +the directory at all. diff --git a/test-data/unlabeled-branch-cvsrepos/proj/a.txt,v b/test-data/unlabeled-branch-cvsrepos/proj/a.txt,v new file mode 100644 index 00000000..956b5aa0 --- /dev/null +++ b/test-data/unlabeled-branch-cvsrepos/proj/a.txt,v @@ -0,0 +1,60 @@ +head 1.1; +access; +symbols + BRANCH:1.1.0.2; +locks; strict; +comment @# @; + + +1.1 +date 2009.08.21.23.07.52; author mhagger; state Exp; +branches + 1.1.2.1 + 1.1.4.1; +next ; + +1.1.2.1 +date 2009.08.21.23.08.54; author mhagger; state Exp; +branches; +next ; + +1.1.4.1 +date 2009.08.21.23.10.11; author mhagger; state Exp; +branches; +next ; + + +desc +@@ + + +1.1 +log +@Initial commit. +@ +text +@1.1 +@ + + +1.1.4.1 +log +@Commit on unlabeled branch. +@ +text +@d1 1 +a1 1 +1.1.4.1 +@ + + +1.1.2.1 +log +@Commit on BRANCH. +@ +text +@d1 1 +a1 1 +1.1.2.1 +@ + -- 2.11.4.GIT