D5994: cleanup: prefer nested context managers to \-continuations

2019-02-21 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG1eb2fc21da12: cleanup: prefer nested context managers to \-continuations (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5994

D5994: cleanup: prefer nested context managers to \-continuations

2019-02-20 Thread durin42 (Augie Fackler)
durin42 added a comment. In https://phab.mercurial-scm.org/D5994#87506, @martinvonz wrote: > > I'd prefer Python accept a tuple of context managers > > I think I'd also prefer if our context managers didn't acquire the resource in `__init__`. That would let us write it with less inden

D5994: cleanup: prefer nested context managers to \-continuations

2019-02-20 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment. > I'd prefer Python accept a tuple of context managers I think I'd also prefer if our context managers didn't acquire the resource in `__init__`. That would let us write it with less indentation as: wlock = wlock or util.nullcontextmanager() lock = l

D5994: cleanup: prefer nested context managers to \-continuations

2019-02-20 Thread durin42 (Augie Fackler)
durin42 created this revision. Herald added a reviewer: martinvonz. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY I'd prefer Python accept a tuple of context managers, but alas it isn't meant to be. This will have to suffice. REPOSITORY