comparison tests/test_util.py @ 867:50c13e01c7e3

test_util: add a load_and_fetch() returning the repo_path
author Patrick Mezard <patrick@mezard.eu>
date Thu, 19 Apr 2012 18:29:28 +0200
parents 20e73b5ab6f7
children cc1c870f1758
comparison
equal deleted inserted replaced
866:20e73b5ab6f7 867:50c13e01c7e3
267 proc = subprocess.Popen(['svnadmin', 'load', path,], stdin=inp, 267 proc = subprocess.Popen(['svnadmin', 'load', path,], stdin=inp,
268 stdout=subprocess.PIPE, stderr=subprocess.STDOUT) 268 stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
269 proc.communicate() 269 proc.communicate()
270 return path 270 return path
271 271
272 def _load_fixture_and_fetch(self, fixture_name, subdir=None, stupid=False, 272 def load_and_fetch(self, fixture_name, subdir=None, stupid=False,
273 layout='auto', startrev=0, externals=None, 273 layout='auto', startrev=0, externals=None,
274 noupdate=True): 274 noupdate=True):
275 if layout == 'single': 275 if layout == 'single':
276 if subdir is None: 276 if subdir is None:
277 subdir = 'trunk' 277 subdir = 'trunk'
278 elif subdir is None: 278 elif subdir is None:
279 subdir = '' 279 subdir = ''
296 if externals: 296 if externals:
297 cmd[:0] = ['--config', 'hgsubversion.externals=%s' % externals] 297 cmd[:0] = ['--config', 'hgsubversion.externals=%s' % externals]
298 298
299 dispatch(cmd) 299 dispatch(cmd)
300 300
301 return hg.repository(testui(), self.wc_path) 301 return hg.repository(testui(), self.wc_path), repo_path
302
303 def _load_fixture_and_fetch(self, *args, **kwargs):
304 repo, repo_path = self.load_and_fetch(*args, **kwargs)
305 return repo
302 306
303 def _add_svn_rev(self, changes): 307 def _add_svn_rev(self, changes):
304 '''changes is a dict of filename -> contents''' 308 '''changes is a dict of filename -> contents'''
305 if self.svn_wc is None: 309 if self.svn_wc is None:
306 self.svn_wc = os.path.join(self.tmpdir, 'testsvn_wc') 310 self.svn_wc = os.path.join(self.tmpdir, 'testsvn_wc')