From 8d4ed9466422d04c2b8839d16f8e44d019b9122c Mon Sep 17 00:00:00 2001 From: mhagger Date: Thu, 24 Feb 2011 04:40:14 +0000 Subject: [PATCH] Handle text transformations more strictly. Allow keyword expansions and EOL fixes to be specified independently when using RCSRevisionReader and CVSRevisionReader, and honor the settings more strictly (even if that means that cvs2svn has to do part of the text transformations itself). git-svn-id: http://cvs2svn.tigris.org/svn/cvs2svn/trunk@5324 be7e6eca-30d4-0310-a8e5-ac0d63af7087 --- cvs2svn_lib/abstract_rcs_revision_manager.py | 18 ++++++++++++------ run-tests.py | 4 +++- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/cvs2svn_lib/abstract_rcs_revision_manager.py b/cvs2svn_lib/abstract_rcs_revision_manager.py index e39fe3ef..dc7ef561 100644 --- a/cvs2svn_lib/abstract_rcs_revision_manager.py +++ b/cvs2svn_lib/abstract_rcs_revision_manager.py @@ -30,15 +30,21 @@ class AbstractRCSRevisionReader(RevisionReader): """A base class for RCSRevisionReader and CVSRevisionReader.""" # A map from (eol_fix, keyword_handling) to ('-k' option needed for - # RCS/CVS, explicit_keyword_handling). + # RCS/CVS, explicit_keyword_handling). The preference is to allow + # CVS/RCS to handle keyword expansion itself whenever possible. But + # it is not possible in combination with eol_fix==False, because the + # only option that CVS/RCS has that leaves the EOLs alone is '-kb' + # mode, which leaves the keywords untouched. Therefore, whenever + # eol_fix is False, we need to use '-kb' mode and then (if + # necessary) expand or collapse the keywords ourselves. _text_options = { - (False, 'collapsed') : (['-kk'], None), - (False, 'expanded') : ([], None), - (False, 'untouched') : ([], None), + (False, 'collapsed') : (['-kb'], 'collapsed'), + (False, 'expanded') : (['-kb'], 'expanded'), + (False, 'untouched') : (['-kb'], None), (True, 'collapsed') : (['-kk'], None), - (True, 'expanded') : ([], None), - (True, 'untouched') : ([], None), + (True, 'expanded') : (['-kkv'], None), + (True, 'untouched') : (['-ko'], None), } def get_pipe_command(self, cvs_rev, k_option): diff --git a/run-tests.py b/run-tests.py index 80c7e48d..ee8afa58 100755 --- a/run-tests.py +++ b/run-tests.py @@ -2404,7 +2404,9 @@ def ignore(): def requires_cvs(): "test that CVS can still do what RCS can't" # See issues 4, 11, 29 for the bugs whose regression we're testing for. - conv = ensure_conversion('requires-cvs', args=["--use-cvs"]) + conv = ensure_conversion( + 'requires-cvs', args=['--use-cvs', '--default-eol=native'], + ) atsign_contents = file(conv.get_wc("trunk", "atsign-add")).read() cl_contents = file(conv.get_wc("trunk", "client_lock.idl")).read() -- 2.11.4.GIT