Mercurial > hg
diff hgext/narrow/narrowcommands.py @ 41760:1eb2fc21da12
cleanup: prefer nested context managers to \-continuations
I'd prefer Python accept a tuple of context managers, but alas it
isn't meant to be. This will have to suffice.
Differential Revision: https://phab.mercurial-scm.org/D5994
author | Augie Fackler <augie@google.com> |
---|---|
date | Wed, 20 Feb 2019 18:02:28 -0500 |
parents | ebbc4e70ebd1 |
children | 6cad258e1348 |
line wrap: on
line diff
--- a/hgext/narrow/narrowcommands.py Wed Feb 20 19:28:51 2019 -0500 +++ b/hgext/narrow/narrowcommands.py Wed Feb 20 18:02:28 2019 -0500 @@ -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()