comparison tests/test_util.py @ 886:d3ff5807f1bd

fold test_startrev and test_verify into a new test; test_verify_and_startrev
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Sat, 12 May 2012 11:12:57 +0200
parents f2de043ac924
children c6388ed0ec0a
comparison
equal deleted inserted replaced
885:99a15c6a283c 886:d3ff5807f1bd
295 proc = subprocess.Popen(['svnadmin', 'load', path,], stdin=inp, 295 proc = subprocess.Popen(['svnadmin', 'load', path,], stdin=inp,
296 stdout=subprocess.PIPE, stderr=subprocess.STDOUT) 296 stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
297 proc.communicate() 297 proc.communicate()
298 return path 298 return path
299 299
300 def load_and_fetch(self, fixture_name, subdir=None, stupid=False, 300 def fetch(self, repo_path, subdir=None, stupid=False, layout='auto', startrev=0,
301 layout='auto', startrev=0, externals=None, 301 externals=None, noupdate=True, dest=None):
302 noupdate=True):
303 if layout == 'single': 302 if layout == 'single':
304 if subdir is None: 303 if subdir is None:
305 subdir = 'trunk' 304 subdir = 'trunk'
306 elif subdir is None: 305 elif subdir is None:
307 subdir = '' 306 subdir = ''
308 repo_path = self.load_svndump(fixture_name)
309 projectpath = repo_path 307 projectpath = repo_path
310 if subdir: 308 if subdir:
311 projectpath += '/' + subdir 309 projectpath += '/' + subdir
312 310
313 cmd = [ 311 cmd = [
324 if externals: 322 if externals:
325 cmd[:0] = ['--config', 'hgsubversion.externals=%s' % externals] 323 cmd[:0] = ['--config', 'hgsubversion.externals=%s' % externals]
326 324
327 dispatch(cmd) 325 dispatch(cmd)
328 326
329 return hg.repository(testui(), self.wc_path), repo_path 327 return hg.repository(testui(), self.wc_path)
328
329 def load_and_fetch(self, fixture_name, *args, **opts):
330 repo_path = self.load_svndump(fixture_name)
331
332 return self.fetch(repo_path, *args, **opts), repo_path
330 333
331 def _load_fixture_and_fetch(self, *args, **kwargs): 334 def _load_fixture_and_fetch(self, *args, **kwargs):
332 repo, repo_path = self.load_and_fetch(*args, **kwargs) 335 repo, repo_path = self.load_and_fetch(*args, **kwargs)
333 return repo 336 return repo
334 337