hgext/evolve.py
changeset 1303 508f9911b042
parent 1302 ebcf23fe3032
child 1313 31e96036acd3
--- a/hgext/evolve.py	Wed Apr 29 15:12:17 2015 -0700
+++ b/hgext/evolve.py	Mon Apr 20 13:39:18 2015 -0700
@@ -616,9 +616,16 @@
 @eh.wrapcommand("pull")
 def wrapmayobsoletewc(origfn, ui, repo, *args, **opts):
     """Warn that the working directory parent is an obsolete changeset"""
-    res = origfn(ui, repo, *args, **opts)
-    if repo['.'].obsolete():
-        ui.warn(_('working directory parent is obsolete!\n'))
+    def warnobsolete():
+        if repo['.'].obsolete():
+            ui.warn(_('working directory parent is obsolete!\n'))
+    wlock = None
+    try:
+        wlock = repo.wlock()
+        repo._afterlock(warnobsolete)
+        res = origfn(ui, repo, *args, **opts)
+    finally:
+        lockmod.release(wlock)
     return res
 
 # XXX this could wrap transaction code