diff tests/test_util.py @ 869:db3a651494f9

test_util: pass repo_path to svnls(), turn it into a function
author Patrick Mezard <patrick@mezard.eu>
date Thu, 19 Apr 2012 18:29:30 +0200
parents cc1c870f1758
children 1eb2a4428c42
line wrap: on
line diff
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -207,6 +207,20 @@ def hgclone(ui, source, dest, update=Tru
         src, dest = hg.clone(ui, source, dest, update=update)
     return src, dest
 
+def svnls(repo_path, path, rev='HEAD'):
+    path = repo_path + '/' + path
+    path = util.normalize_url(fileurl(path))
+    args = ['svn', 'ls', '-r', rev, '-R', path]
+    p = subprocess.Popen(args,
+                         stdout=subprocess.PIPE,
+                         stderr=subprocess.STDOUT)
+    stdout, stderr = p.communicate()
+    if p.returncode:
+        raise Exception('svn ls failed on %s: %r' % (path, stderr))
+    entries = [e.strip('/') for e in stdout.splitlines()]
+    entries.sort()
+    return entries
+
 class TestBase(unittest.TestCase):
     def setUp(self):
         _verify_our_modules()
@@ -339,20 +353,6 @@ class TestBase(unittest.TestCase):
         self.assertEqual(expected_extra_back, after - before)
         return res
 
-    def svnls(self, path, rev='HEAD'):
-        path = self.repo_path + '/' + path
-        path = util.normalize_url(fileurl(path))
-        args = ['svn', 'ls', '-r', rev, '-R', path]
-        p = subprocess.Popen(args,
-                             stdout=subprocess.PIPE,
-                             stderr=subprocess.STDOUT)
-        stdout, stderr = p.communicate()
-        if p.returncode:
-            raise Exception('svn ls failed on %s: %r' % (path, stderr))
-        entries = [e.strip('/') for e in stdout.splitlines()]
-        entries.sort()
-        return entries
-
     def svnco(self, svnpath, rev, path):
         path = os.path.join(self.wc_path, path)
         subpath = os.path.dirname(path)