diff tests/comprehensive/test_verify_and_startrev.py @ 1092:cd0d14e25757

layouts: add custom layout for those of us that need weird mappings This adds a config-driven custom layout, targeted at the case where you need to fetch a small subset of a large number of subversion branches, or where your subversion layout doesn't match the standard trunk/branches/tags layout very well.
author David Schleimer <dschleimer@fb.com>
date Mon, 26 Aug 2013 16:40:31 -0700
parents cd256960b622
children ff4e102932ed
line wrap: on
line diff
--- a/tests/comprehensive/test_verify_and_startrev.py
+++ b/tests/comprehensive/test_verify_and_startrev.py
@@ -39,7 +39,13 @@ from hgsubversion import verify
 
 def _do_case(self, name, layout):
     subdir = test_util.subdir.get(name, '')
-    repo, svnpath = self.load_and_fetch(name, subdir=subdir, layout=layout)
+    config = {}
+    for branch, path in test_util.custom.get(name, {}).iteritems():
+        config['hgsubversionbranch.%s' % branch] = path
+    repo, svnpath = self.load_and_fetch(name,
+                                        subdir=subdir,
+                                        layout=layout,
+                                        config=config)
     assert test_util.repolen(self.repo) > 0
     for i in repo:
         ctx = repo[i]
@@ -98,7 +104,8 @@ for case in fixtures:
     bname = 'test_' + case[:-len('.svndump')]
     if case not in _skipstandard:
         attrs[bname] = buildmethod(case, bname, 'standard')
-    name = bname + '_single'
-    attrs[name] = buildmethod(case, name, 'single')
+    attrs[bname + '_single'] = buildmethod(case, bname + '_single', 'single')
+    if case in test_util.custom:
+        attrs[bname + '_custom'] = buildmethod(case, bname + '_custom', 'custom')
 
 VerifyTests = type('VerifyTests', (test_util.TestBase,), attrs)