diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py --- a/hgext/largefiles/overrides.py +++ b/hgext/largefiles/overrides.py @@ -664,9 +664,9 @@ _('destination largefile already exists')) copiedfiles.append((src, dest)) orig(src, dest, *args, **kwargs) - with extensions.wrappedfunction(util, 'copyfile', overridecopyfile), \ - extensions.wrappedfunction(scmutil, 'match', overridematch): - result += orig(ui, repo, listpats, opts, rename) + with extensions.wrappedfunction(util, 'copyfile', overridecopyfile): + with extensions.wrappedfunction(scmutil, 'match', overridematch): + result += orig(ui, repo, listpats, opts, rename) lfdirstate = lfutil.openlfdirstate(ui, repo) for (src, dest) in copiedfiles: diff --git a/hgext/narrow/narrowcommands.py b/hgext/narrow/narrowcommands.py --- a/hgext/narrow/narrowcommands.py +++ b/hgext/narrow/narrowcommands.py @@ -278,9 +278,9 @@ p1, p2 = ds.p1(), ds.p2() with ds.parentchange(): ds.setparents(node.nullid, node.nullid) - with wrappedextraprepare,\ - repo.ui.configoverride(overrides, 'widen'): - exchange.pull(repo, remote, heads=common) + with wrappedextraprepare: + with repo.ui.configoverride(overrides, 'widen'): + exchange.pull(repo, remote, heads=common) with ds.parentchange(): ds.setparents(p1, p2) else: @@ -296,11 +296,11 @@ 'ellipses': False, }).result() - with repo.transaction('widening') as tr,\ - repo.ui.configoverride(overrides, 'widen'): - tgetter = lambda: tr - bundle2.processbundle(repo, bundle, - transactiongetter=tgetter) + with repo.transaction('widening') as tr: + with repo.ui.configoverride(overrides, 'widen'): + tgetter = lambda: tr + bundle2.processbundle(repo, bundle, + transactiongetter=tgetter) with repo.transaction('widening'): repo.setnewnarrowpats() diff --git a/mercurial/exchange.py b/mercurial/exchange.py --- a/mercurial/exchange.py +++ b/mercurial/exchange.py @@ -556,18 +556,18 @@ % stringutil.forcebytestr(err)) pushop.ui.debug(msg) - with wlock or util.nullcontextmanager(), \ - lock or util.nullcontextmanager(), \ - pushop.trmanager or util.nullcontextmanager(): - pushop.repo.checkpush(pushop) - _checkpublish(pushop) - _pushdiscovery(pushop) - if not _forcebundle1(pushop): - _pushbundle2(pushop) - _pushchangeset(pushop) - _pushsyncphase(pushop) - _pushobsolete(pushop) - _pushbookmark(pushop) + with wlock or util.nullcontextmanager(): + with lock or util.nullcontextmanager(): + with pushop.trmanager or util.nullcontextmanager(): + pushop.repo.checkpush(pushop) + _checkpublish(pushop) + _pushdiscovery(pushop) + if not _forcebundle1(pushop): + _pushbundle2(pushop) + _pushchangeset(pushop) + _pushsyncphase(pushop) + _pushobsolete(pushop) + _pushbookmark(pushop) if repo.ui.configbool('experimental', 'remotenames'): logexchange.pullremotenames(repo, remote)