diff tests/test_util.py @ 793:e698be84c22d

pushmod: fix binary files svn:mime-type (issue255) - Handle single directory layout - Reset svn:mime-type when the file is no longer binary
author Patrick Mezard <pmezard@gmail.com>
date Thu, 10 Mar 2011 22:17:56 +0100
parents f3af4fe98d37
children f07bfd66db13
line wrap: on
line diff
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -351,6 +351,18 @@ class TestBase(unittest.TestCase):
         if p.returncode:
             raise Exception('svn co failed on %s: %r' % (svnpath, stderr))
 
+    def svnpropget(self, path, prop, rev='HEAD'):
+        path = self.repo_path + '/' + path
+        path = util.normalize_url(fileurl(path))
+        args = ['svn', 'propget', '-r', str(rev), prop, 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))
+        return stdout.strip()
+
     def commitchanges(self, changes, parent='tip', message='automated test'):
         """Commit changes to mercurial directory