# HG changeset patch # User Bryan O'Sullivan # Date 1452892486 28800 # Node ID 0c48c566bab00e07adaabd27add3ebbcba5a5501 # Parent 6ad5e134ef2e2508d6d5e46a29fb6bbe4bf31c1b with: use context manager for wlock in graft diff -r 6ad5e134ef2e -r 0c48c566bab0 mercurial/commands.py --- a/mercurial/commands.py Fri Jan 15 13:14:46 2016 -0800 +++ b/mercurial/commands.py Fri Jan 15 13:14:46 2016 -0800 @@ -3869,12 +3869,8 @@ Returns 0 on successful completion. ''' - wlock = None - try: - wlock = repo.wlock() + with repo.wlock(): return _dograft(ui, repo, *revs, **opts) - finally: - release(wlock) def _dograft(ui, repo, *revs, **opts): revs = list(revs)