diff tests/test_util.py @ 764:bc5c176b63eb

svnexternals: support pushing subrepo based externals
author Patrick Mezard <pmezard@gmail.com>
date Thu, 25 Nov 2010 21:55:21 +0100
parents c31a1f92e1c6
children f3af4fe98d37
line wrap: on
line diff
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -337,6 +337,20 @@ class TestBase(unittest.TestCase):
         entries.sort()
         return entries
 
+    def svnco(self, svnpath, rev, path):
+        path = os.path.join(self.wc_path, path)
+        subpath = os.path.dirname(path)
+        if not os.path.isdir(subpath):
+            os.makedirs(subpath)
+        svnpath = fileurl(self.repo_path + '/' + svnpath)
+        args = ['svn', 'co', '-r', rev, svnpath, path]
+        p = subprocess.Popen(args,
+                             stdout=subprocess.PIPE,
+                             stderr=subprocess.STDOUT)
+        stdout, stderr = p.communicate()
+        if p.returncode:
+            raise Exception('svn co failed on %s: %r' % (svnpath, stderr))
+
     def commitchanges(self, changes, parent='tip', message='automated test'):
         """Commit changes to mercurial directory