[PATCH 4 of 5] commands.bookmarks: move cur initialization to inside wlock

Siddharth Agarwal sid0 at fb.com
Thu Nov 21 19:13:12 CST 2013


# HG changeset patch
# User Siddharth Agarwal <sid0 at fb.com>
# Date 1384893737 28800
#      Tue Nov 19 12:42:17 2013 -0800
# Node ID a96328b05252b5fa8a15234060dc363dc96aa5ef
# Parent  5f89108d45e46b4a7e1f86e100e4da72b7f98729
commands.bookmarks: move cur initialization to inside wlock

This is more correct because we now fetch '.' while nothing else can interfere
with it.

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -808,7 +808,6 @@
     inactive = opts.get('inactive')
 
     hexfn = ui.debugflag and hex or short
-    cur   = repo.changectx('.').node()
 
     def checkformat(mark):
         mark = mark.strip()
@@ -862,6 +861,7 @@
     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:


More information about the Mercurial-devel mailing list