From 7ebae85bab698a5a58dd204fe2049ca122abd59a Mon Sep 17 00:00:00 2001 From: mhagger Date: Mon, 28 Mar 2011 07:22:29 +0000 Subject: [PATCH] Change Project constructor to wrap exclude_paths in a set. This means that the config files can pass in any iterable. git-svn-id: http://cvs2svn.tigris.org/svn/cvs2svn/trunk@5333 be7e6eca-30d4-0310-a8e5-ac0d63af7087 --- cvs2bzr-example.options | 2 +- cvs2git-example.options | 2 +- cvs2hg-example.options | 2 +- cvs2svn-example.options | 2 +- cvs2svn_lib/dvcs_common.py | 2 +- cvs2svn_lib/project.py | 12 ++++++------ cvs2svn_lib/svn_run_options.py | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cvs2bzr-example.options b/cvs2bzr-example.options index fe9967c0..192b2bef 100644 --- a/cvs2bzr-example.options +++ b/cvs2bzr-example.options @@ -577,6 +577,6 @@ run_options.set_project( # Exclude paths from the conversion. Should be relative to # repository path and use forward slashes: - #exclude_paths=set(['file-to-exclude.txt,v', 'dir/to/exclude']), + #exclude_paths=['file-to-exclude.txt,v', 'dir/to/exclude'], ) diff --git a/cvs2git-example.options b/cvs2git-example.options index 6d1daa17..43835ee6 100644 --- a/cvs2git-example.options +++ b/cvs2git-example.options @@ -605,6 +605,6 @@ run_options.set_project( # Exclude paths from the conversion. Should be relative to # repository path and use forward slashes: - #exclude_paths=set(['file-to-exclude.txt,v', 'dir/to/exclude']), + #exclude_paths=['file-to-exclude.txt,v', 'dir/to/exclude'], ) diff --git a/cvs2hg-example.options b/cvs2hg-example.options index e5adbe58..3b76c3a3 100644 --- a/cvs2hg-example.options +++ b/cvs2hg-example.options @@ -574,6 +574,6 @@ run_options.set_project( # Exclude paths from the conversion. Should be relative to # repository path and use forward slashes: - #exclude_paths=set(['file-to-exclude.txt,v', 'dir/to/exclude']), + #exclude_paths=['file-to-exclude.txt,v', 'dir/to/exclude'], ) diff --git a/cvs2svn-example.options b/cvs2svn-example.options index 95353d87..c3f12419 100644 --- a/cvs2svn-example.options +++ b/cvs2svn-example.options @@ -655,7 +655,7 @@ run_options.add_project( # Exclude paths from the conversion. Should be relative to # repository path and use forward slashes: - #exclude_paths=set(['file-to-exclude.txt,v', 'dir/to/exclude']), + #exclude_paths=['file-to-exclude.txt,v', 'dir/to/exclude'], ) # Add a second project, to be stored to projA/trunk, projA/branches, diff --git a/cvs2svn_lib/dvcs_common.py b/cvs2svn_lib/dvcs_common.py index b3dee5f1..d37c896c 100644 --- a/cvs2svn_lib/dvcs_common.py +++ b/cvs2svn_lib/dvcs_common.py @@ -74,7 +74,7 @@ class DVCSRunOptions(RunOptions): project_cvs_repos_path, symbol_transforms=None, symbol_strategy_rules=[], - exclude_paths=set(), + exclude_paths=[], ): """Set the project to be converted. diff --git a/cvs2svn_lib/project.py b/cvs2svn_lib/project.py index 8bb6e4be..39afbe6d 100644 --- a/cvs2svn_lib/project.py +++ b/cvs2svn_lib/project.py @@ -53,7 +53,7 @@ class Project(object): self, id, project_cvs_repos_path, initial_directories=[], symbol_transforms=None, - exclude_paths=set(), + exclude_paths=[], ): """Create a new Project record. @@ -68,10 +68,10 @@ class Project(object): which will be used to transform any symbol names within this project. - EXCLUDE_PATHS is a set (or anything implementing __contains__) of - paths that should be excluded from the conversion. The paths should - be relative to PROJECT_CVS_REPOS_PATH and use slashes ("/"). Paths - for individual files should include the ",v" extension. + EXCLUDE_PATHS is an iterable of paths that should be excluded from + the conversion. The paths should be relative to + PROJECT_CVS_REPOS_PATH and use slashes ('/'). Paths for + individual files should include the ',v' extension. """ self.id = id @@ -107,7 +107,7 @@ class Project(object): self.symbol_transform = CompoundSymbolTransform(symbol_transforms) - self.exclude_paths = exclude_paths + self.exclude_paths = set(exclude_paths) # The ID of the Trunk instance for this Project. This member is # filled in during CollectRevsPass. diff --git a/cvs2svn_lib/svn_run_options.py b/cvs2svn_lib/svn_run_options.py index 4d4375c8..c2a71857 100644 --- a/cvs2svn_lib/svn_run_options.py +++ b/cvs2svn_lib/svn_run_options.py @@ -429,7 +429,7 @@ A directory called \\fIcvs2svn-tmp\\fR (or the directory specified by initial_directories=[], symbol_transforms=None, symbol_strategy_rules=[], - exclude_paths=set(), + exclude_paths=[], ): """Add a project to be converted. -- 2.11.4.GIT