hgext/evolve.py
branchmercurial-3.3
changeset 1451 73eb4f33f9dc
parent 1449 9be1cadf7a07
child 1452 1bcbd14cf159
child 1454 c79bdc856350
--- a/hgext/evolve.py	Thu Jun 25 16:55:27 2015 -0700
+++ b/hgext/evolve.py	Thu Jun 25 17:22:17 2015 -0700
@@ -682,18 +682,16 @@
 @eh.wrapcommand("pull")
 def wrapmayobsoletewc(origfn, ui, repo, *args, **opts):
     """Warn that the working directory parent is an obsolete changeset"""
-    def warnobsolete():
-        if repo['.'].obsolete():
+
+    prior = (repo['.'].obsolete(), repo['.'].rev)
+    try:
+        res = origfn(ui, repo, *args, **opts)
+    finally:
+        after = (repo['.'].obsolete(), repo['.'].rev)
+        if prior != after and after[0]:
             ui.warn(_('working directory parent is obsolete!\n'))
             if (not ui.quiet) and obsolete.isenabled(repo, commandopt):
                 ui.warn(_('(use "hg evolve" to update to its successor)\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