diff -r 60b850b7e4ef -r 7ec3cb246291 hgext/strip.py --- a/hgext/strip.py Fri Jan 15 13:14:47 2016 -0800 +++ b/hgext/strip.py Fri Jan 15 13:14:47 2016 -0800 @@ -133,8 +133,7 @@ revs = list(revs) + opts.get('rev') revs = set(scmutil.revrange(repo, revs)) - wlock = repo.wlock() - try: + with repo.wlock(): bookmarks = set(opts.get('bookmark')) if bookmarks: repomarks = repo._bookmarks @@ -232,7 +231,5 @@ strip(ui, repo, revs, backup=backup, update=update, force=opts.get('force'), bookmarks=bookmarks) - finally: - wlock.release() return 0