From patchwork Fri Dec 20 16:04:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [4, of, 5, V3] commands.bookmarks: move cur initialization to inside wlock From: Siddharth Agarwal X-Patchwork-Id: 3222 Message-Id: To: Date: Fri, 20 Dec 2013 21:34:04 +0530 # HG changeset patch # User Siddharth Agarwal # Date 1384893737 28800 # Tue Nov 19 12:42:17 2013 -0800 # Node ID e04bd1e754d2910a9b3b6051fd5f229f1c4d78d7 # Parent 86fa1866bd2bcdcf24c9ec1815a7f27d13d6b9cf commands.bookmarks: move cur initialization to inside wlock This is more correct because we now fetch '.' while nothing else can interfere with it. diff -r 86fa1866bd2bcdcf24c9ec1815a7f27d13d6b9cf -r e04bd1e754d2910a9b3b6051fd5f229f1c4d78d7 mercurial/commands.py --- a/mercurial/commands.py Thu Nov 21 17:11:04 2013 -0800 +++ b/mercurial/commands.py Tue Nov 19 12:42:17 2013 -0800 @@ -808,7 +808,6 @@ def bookmark(ui, repo, *names, **opts): inactive = opts.get('inactive') hexfn = ui.debugflag and hex or short - cur = repo.changectx('.').node() def checkformat(mark): mark = mark.strip() @@ -864,6 +863,7 @@ def bookmark(ui, repo, *names, **opts): if delete or rename or names or inactive: wlock = repo.wlock() try: + cur = repo.changectx('.').node() marks = repo._bookmarks if delete: for mark in names: