hgext/evolve.py
branchstable
changeset 1527 e080d2ae2656
parent 1519 c15d6168412f
child 1528 afb0a33c4f6c
--- a/hgext/evolve.py	Fri Nov 06 18:02:05 2015 -0500
+++ b/hgext/evolve.py	Fri Nov 06 18:37:16 2015 -0500
@@ -678,16 +678,19 @@
 
 # This section take care of issue warning to the user when troubles appear
 
+
+def _warnobsoletewc(ui, repo):
+    if repo['.'].obsolete():
+        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'))
+
 @eh.wrapcommand("update")
-@eh.wrapcommand("parents")
 @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():
-            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'))
+        _warnobsoletewc(ui, repo)
     wlock = None
     try:
         wlock = repo.wlock()
@@ -697,6 +700,12 @@
         lockmod.release(wlock)
     return res
 
+@eh.wrapcommand("parents")
+def wrapparents(origfn, ui, repo, *args, **opts):
+    res = origfn(ui, repo, *args, **opts)
+    _warnobsoletewc(ui, repo)
+    return res
+
 # XXX this could wrap transaction code
 # XXX (but this is a bit a layer violation)
 @eh.wrapcommand("commit")