[PATCH 3 of 4 evolve-ext] evolve: rename handlenotrouble to _handlenotrouble and add doc

Laurent Charignon lcharignon at fb.com
Tue May 5 20:22:52 CDT 2015


# HG changeset patch
# User Laurent Charignon <lcharignon at fb.com>
# Date 1430860149 25200
#      Tue May 05 14:09:09 2015 -0700
# Node ID dee3756a1deb516c63a961ed8d2d438bd85a0baa
# Parent  5b3c5ad3a7e110b0f64ceeb11830f992d49d3ff2
evolve: rename handlenotrouble to _handlenotrouble and add doc

As suggested by Pierre-Yves on his comments on
f113636997660b807c36cf1d0a06b76d53ada1a4 we make it clear that this function
is private and explain what it does.

diff --git a/hgext/evolve.py b/hgext/evolve.py
--- a/hgext/evolve.py
+++ b/hgext/evolve.py
@@ -1168,7 +1168,9 @@
     finally:
         lockmod.release(tr, lock, wlock)
 
-def handlenotrouble(ui, repo, startnode, dryrunopt):
+def _handlenotrouble(ui, repo, startnode, dryrunopt):
+    """ Used by the evolve function to display an error message when
+    no troubles can be resolved """
     if repo['.'].obsolete():
         displayer = cmdutil.show_changeset(
             ui, repo, {'template': shorttemplate})
@@ -1292,7 +1294,7 @@
 
     # No troubles found, warn the user that they might want to use --all
     if not _revs:
-        return handlenotrouble(ui, repo, startnode, dryrunopt)
+        return _handlenotrouble(ui, repo, startnode, dryrunopt)
 
     # Solve the troubles
     seen = 1


More information about the Mercurial-devel mailing list