comparison 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
comparison
equal deleted inserted replaced
763:6463b34bbcb6 764:bc5c176b63eb
334 if p.returncode: 334 if p.returncode:
335 raise Exception('svn ls failed on %s: %r' % (path, stderr)) 335 raise Exception('svn ls failed on %s: %r' % (path, stderr))
336 entries = [e.strip('/') for e in stdout.splitlines()] 336 entries = [e.strip('/') for e in stdout.splitlines()]
337 entries.sort() 337 entries.sort()
338 return entries 338 return entries
339
340 def svnco(self, svnpath, rev, path):
341 path = os.path.join(self.wc_path, path)
342 subpath = os.path.dirname(path)
343 if not os.path.isdir(subpath):
344 os.makedirs(subpath)
345 svnpath = fileurl(self.repo_path + '/' + svnpath)
346 args = ['svn', 'co', '-r', rev, svnpath, path]
347 p = subprocess.Popen(args,
348 stdout=subprocess.PIPE,
349 stderr=subprocess.STDOUT)
350 stdout, stderr = p.communicate()
351 if p.returncode:
352 raise Exception('svn co failed on %s: %r' % (svnpath, stderr))
339 353
340 def commitchanges(self, changes, parent='tip', message='automated test'): 354 def commitchanges(self, changes, parent='tip', message='automated test'):
341 """Commit changes to mercurial directory 355 """Commit changes to mercurial directory
342 356
343 'changes' is a sequence of tuples (source, dest, data). It can look 357 'changes' is a sequence of tuples (source, dest, data). It can look