##// END OF EJS Templates
cleanup: prefer nested context managers to \-continuations...
Augie Fackler -
r41926:1eb2fc21 default
parent child Browse files
Show More
@@ -664,8 +664,8 b' def overridecopy(orig, ui, repo, pats, o'
664 _('destination largefile already exists'))
664 _('destination largefile already exists'))
665 copiedfiles.append((src, dest))
665 copiedfiles.append((src, dest))
666 orig(src, dest, *args, **kwargs)
666 orig(src, dest, *args, **kwargs)
667 with extensions.wrappedfunction(util, 'copyfile', overridecopyfile), \
667 with extensions.wrappedfunction(util, 'copyfile', overridecopyfile):
668 extensions.wrappedfunction(scmutil, 'match', overridematch):
668 with extensions.wrappedfunction(scmutil, 'match', overridematch):
669 result += orig(ui, repo, listpats, opts, rename)
669 result += orig(ui, repo, listpats, opts, rename)
670
670
671 lfdirstate = lfutil.openlfdirstate(ui, repo)
671 lfdirstate = lfutil.openlfdirstate(ui, repo)
@@ -278,8 +278,8 b' def _widen(ui, repo, remote, commoninc, '
278 p1, p2 = ds.p1(), ds.p2()
278 p1, p2 = ds.p1(), ds.p2()
279 with ds.parentchange():
279 with ds.parentchange():
280 ds.setparents(node.nullid, node.nullid)
280 ds.setparents(node.nullid, node.nullid)
281 with wrappedextraprepare,\
281 with wrappedextraprepare:
282 repo.ui.configoverride(overrides, 'widen'):
282 with repo.ui.configoverride(overrides, 'widen'):
283 exchange.pull(repo, remote, heads=common)
283 exchange.pull(repo, remote, heads=common)
284 with ds.parentchange():
284 with ds.parentchange():
285 ds.setparents(p1, p2)
285 ds.setparents(p1, p2)
@@ -296,8 +296,8 b' def _widen(ui, repo, remote, commoninc, '
296 'ellipses': False,
296 'ellipses': False,
297 }).result()
297 }).result()
298
298
299 with repo.transaction('widening') as tr,\
299 with repo.transaction('widening') as tr:
300 repo.ui.configoverride(overrides, 'widen'):
300 with repo.ui.configoverride(overrides, 'widen'):
301 tgetter = lambda: tr
301 tgetter = lambda: tr
302 bundle2.processbundle(repo, bundle,
302 bundle2.processbundle(repo, bundle,
303 transactiongetter=tgetter)
303 transactiongetter=tgetter)
@@ -556,9 +556,9 b' def push(repo, remote, force=False, revs'
556 % stringutil.forcebytestr(err))
556 % stringutil.forcebytestr(err))
557 pushop.ui.debug(msg)
557 pushop.ui.debug(msg)
558
558
559 with wlock or util.nullcontextmanager(), \
559 with wlock or util.nullcontextmanager():
560 lock or util.nullcontextmanager(), \
560 with lock or util.nullcontextmanager():
561 pushop.trmanager or util.nullcontextmanager():
561 with pushop.trmanager or util.nullcontextmanager():
562 pushop.repo.checkpush(pushop)
562 pushop.repo.checkpush(pushop)
563 _checkpublish(pushop)
563 _checkpublish(pushop)
564 _pushdiscovery(pushop)
564 _pushdiscovery(pushop)
General Comments 0
You need to be logged in to leave comments. Login now