Skip to content
Snippets Groups Projects
Commit add2ba16 authored by Bryan O'Sullivan's avatar Bryan O'Sullivan
Browse files

with: use context manager for transaction in strip

parent 4ff0e234
Branches
Tags
No related merge requests found
......@@ -185,9 +185,8 @@
# silence internal shuffling chatter
repo.ui.pushbuffer()
if isinstance(gen, bundle2.unbundle20):
tr = repo.transaction('strip')
tr.hookargs = {'source': 'strip',
'url': 'bundle:' + vfs.join(chgrpfile)}
try:
with repo.transaction('strip') as tr:
tr.hookargs = {'source': 'strip',
'url': 'bundle:' + vfs.join(chgrpfile)}
bundle2.applybundle(repo, gen, tr, source='strip',
url='bundle:' + vfs.join(chgrpfile))
......@@ -192,8 +191,5 @@
bundle2.applybundle(repo, gen, tr, source='strip',
url='bundle:' + vfs.join(chgrpfile))
tr.close()
finally:
tr.release()
else:
gen.apply(repo, 'strip', 'bundle:' + vfs.join(chgrpfile), True)
if not repo.ui.verbose:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment