diff tests/test_util.py @ 762:c31a1f92e1c6

svnexternals: preliminary support for subrepos based externals At this point, only pulling externals definitions into .hgsub and .hgsubstate is supported. One difference between subrepos and svn:externals is the former separate the source definition and target revision in two files, while svn:externals definitions contain both. To handle this, the svn:externals revision references is replaced with a {REV} placeholder and stored in .hgsub, prefixed with the external base directory separated with a ':', while the revision is extracted in .hgsubstate. For instance, the following external: -r3 ^/externals/proj2@2 deps/proj2 Becomes: (.hgsub) deps/proj2 = [hgsubversion] :-r{REV} ^/externals/proj2@2 deps/proj2 (.hgsubstate) 3 deps/proj2
author Patrick Mezard <pmezard@gmail.com>
date Thu, 25 Nov 2010 21:55:21 +0100
parents 6d6be5284056
children bc5c176b63eb
line wrap: on
line diff
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -172,7 +172,7 @@ def load_svndump_fixture(path, fixture_n
 
 def load_fixture_and_fetch(fixture_name, repo_path, wc_path, stupid=False,
                            subdir='', noupdate=True, layout='auto',
-                           startrev=0):
+                           startrev=0, externals=None):
     load_svndump_fixture(repo_path, fixture_name)
     if subdir:
         repo_path += '/' + subdir
@@ -188,6 +188,8 @@ def load_fixture_and_fetch(fixture_name,
         cmd.append('--stupid')
     if noupdate:
         cmd.append('--noupdate')
+    if externals:
+        cmd[:0] = ['--config', 'hgsubversion.externals=%s' % externals]
 
     dispatch.dispatch(cmd)
 
@@ -275,7 +277,7 @@ class TestBase(unittest.TestCase):
         return testui(stupid, layout)
 
     def _load_fixture_and_fetch(self, fixture_name, subdir=None, stupid=False,
-                                layout='auto', startrev=0):
+                                layout='auto', startrev=0, externals=None):
         if layout == 'single':
             if subdir is None:
                 subdir = 'trunk'
@@ -284,7 +286,7 @@ class TestBase(unittest.TestCase):
         return load_fixture_and_fetch(fixture_name, self.repo_path,
                                       self.wc_path, subdir=subdir,
                                       stupid=stupid, layout=layout,
-                                      startrev=startrev)
+                                      startrev=startrev, externals=externals)
 
     def _add_svn_rev(self, changes):
         '''changes is a dict of filename -> contents'''