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

login
register
mail settings
Submitter Siddharth Agarwal
Date Nov. 22, 2013, 1:13 a.m.
Message ID <a96328b05252b5fa8a15.1385082792@dev1091.prn1.facebook.com>
Download mbox | patch
Permalink /patch/3089/
State Superseded
Commit 8a133190da895d882cef515a7e7db6cfc65daba6
Headers show

Comments

Siddharth Agarwal - Nov. 22, 2013, 1:13 a.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@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.

Patch

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: