Re: Feature request: "Surrogate" repository root for $Header$ and $Source$ keyword expansion?

Maciek Sakrejda <[email protected]>
Newsgroups gmane.comp.version-control.subversion.cvs2svn.user
Message-ID <CAH_hXRZMNMJu7Py=aNA_6b0ZrMV0u8aHqPR7YC-_FG8k_ZyZHQ@mail.gmail.com>
Great! How is the attached for a start? It passes the
cvs_surrogate_root through set_project and uses that (if specified) as
proposed. I haven't added any tests or sample config file docs yet,
but is this the right approach? It seems to work on my repository.

I tried running the existing tests, but several fail for me on trunk
(r5374) even without my patch. The failures are in #86:

EXCEPTION: Failure: Symbol filled twice in a row
Traceback (most recent call last):
  File "/home/maciek/jdbc-to-git/cvs2svn-trunk/svntest/main.py", line
1163, in run
    rc = self.pred.run(sandbox)
  File "/home/maciek/jdbc-to-git/cvs2svn-trunk/svntest/testcase.py",
line 108, in run
    return self._delegate.run(sandbox)
  File "./run-tests.py", line 829, in run
    return self.func()
  File "./run-tests.py", line 2531, in double_fill2
    raise Failure('Symbol filled twice in a row')
Failure: Symbol filled twice in a row
XFAIL: run-tests.py 86: reveal a second bug that created a branch twice

#128:

EXCEPTION: Failure: Revision 3 changed paths list was:
{'/tags/tag1 (from /trunk:2)': 'A', '/tags/tag1/test/b': 'D'}

It should have been:
{'/tags/tag1 (from /trunk:3)': 'A'}


Traceback (most recent call last):
  File "/home/maciek/jdbc-to-git/cvs2svn-trunk/svntest/main.py", line
1163, in run
    rc = self.pred.run(sandbox)
  File "/home/maciek/jdbc-to-git/cvs2svn-trunk/svntest/testcase.py",
line 108, in run
    return self._delegate.run(sandbox)
  File "./run-tests.py", line 829, in run
    return self.func()
  File "./run-tests.py", line 3151, in tagging_after_delete
    log.check_changes(expected)
  File "./run-tests.py", line 300, in check_changes
    % (self.revision, self.changed_paths, cp,)
Failure: Revision 3 changed paths list was:
{'/tags/tag1 (from /trunk:2)': 'A', '/tags/tag1/test/b': 'D'}

It should have been:
{'/tags/tag1 (from /trunk:3)': 'A'}


XFAIL: run-tests.py 128: optimal tag after deleting files


and #162:

Traceback (most recent call last):
  File "/home/maciek/jdbc-to-git/cvs2svn-trunk/svntest/main.py", line
1163, in run
    rc = self.pred.run(sandbox)
  File "/home/maciek/jdbc-to-git/cvs2svn-trunk/svntest/testcase.py",
line 108, in run
    return self._delegate.run(sandbox)
  File "./run-tests.py", line 829, in run
    return self.func()
  File "./run-tests.py", line 3628, in add_cvsignore_to_branch_test
    raise Failure()
Failure
XFAIL: run-tests.py 162: check adding .cvsignore to an existing branch

I'm on Ubuntu 11.04 with Python 2.7.1.
---
Maciek Sakrejda | System Architect | Truviso

1065 E. Hillsdale Blvd., Suite 215
Foster City, CA 94404
(650) 242-3500 Main
www.truviso.com

------------------------------------------------------
http://cvs2svn.tigris.org/ds/viewMessage.do?dsForumId=1670&dsMessageId=2911768

To unsubscribe from this discussion, e-mail: [[email protected]].
surrogate-root.patch (text/x-diff, 2.2 KB)
Index: cvs2svn_lib/dvcs_common.py
===================================================================
--- cvs2svn_lib/dvcs_common.py	(revision 5374)
+++ cvs2svn_lib/dvcs_common.py	(working copy)
@@ -75,6 +75,7 @@
         symbol_transforms=None,
         symbol_strategy_rules=[],
         exclude_paths=[],
+        project_cvs_surrogate_root=None
         ):
     """Set the project to be converted.
 
@@ -92,6 +93,7 @@
         project_cvs_repos_path,
         symbol_transforms=symbol_transforms,
         exclude_paths=exclude_paths,
+        cvs_surrogate_root=project_cvs_surrogate_root
         )
 
     self.projects = [project]
Index: cvs2svn_lib/project.py
===================================================================
--- cvs2svn_lib/project.py	(revision 5374)
+++ cvs2svn_lib/project.py	(working copy)
@@ -54,6 +54,7 @@
         initial_directories=[],
         symbol_transforms=None,
         exclude_paths=[],
+        cvs_surrogate_root=None
         ):
     """Create a new Project record.
 
@@ -72,6 +73,11 @@
     the conversion.  The paths should be relative to
     PROJECT_CVS_REPOS_PATH and use slashes ('/').  Paths for
     individual files should include the ',v' extension.
+
+    CVS_SURROGATE_REPOS_ROOT can be provided as an substitute for
+    PROJECT_CVS_REPOS_PATH in CVS $Header$ and $Source$ keyword
+    expansion. If this is not provided, the root is determined from
+    PROJECT_CVS_REPOS_PATH.
     """
 
     self.id = id
@@ -85,6 +91,8 @@
         self.determine_repository_root(
             os.path.abspath(self.project_cvs_repos_path))
 
+    self.cvs_surrogate_root = cvs_surrogate_root
+
     # The SVN directories to add when the project is first created:
     self._initial_directories = []
 
Index: cvs2svn_lib/keyword_expander.py
===================================================================
--- cvs2svn_lib/keyword_expander.py	(revision 5374)
+++ cvs2svn_lib/keyword_expander.py	(working copy)
@@ -95,7 +95,7 @@
   def source(self):
     project = self.cvs_rev.cvs_file.project
     return '%s/%s%s,v' % (
-        project.cvs_repository_root,
+        project.cvs_surrogate_root or project.cvs_repository_root,
         project.cvs_module,
         self.cvs_rev.cvs_file.cvs_path,
         )
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.