[PATCH 06 of 11] upgrade: drop the prefix to the 'allowednewrequirements' function

Pierre-Yves David pierre-yves.david at ens-lyon.org
Mon Apr 10 12:48:57 EDT 2017


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
# Date 1491840191 -7200
#      Mon Apr 10 18:03:11 2017 +0200
# Node ID e6379cf8208572bb5e919db628de8a7b2342113d
# Parent  4e1fbf6c9d18edde1f05e844d43382221bb3a26e
# EXP-Topic upgraderepo
# Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
#              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r e6379cf82085
upgrade: drop the prefix to the 'allowednewrequirements' function

Now that we are in the 'upgrade' module we can simplify the name.

diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py
--- a/mercurial/upgrade.py
+++ b/mercurial/upgrade.py
@@ -78,7 +78,7 @@ def upgradesupporteddestrequirements(rep
         'store',
     ])
 
-def upgradeallowednewrequirements(repo):
+def allowednewrequirements(repo):
     """Obtain requirements that can be added to a repository during upgrade.
 
     This is used to disallow proposed requirements from being added when
@@ -613,7 +613,7 @@ def upgraderepo(ui, repo, run=False, opt
                             'removed: %s') % _(', ').join(sorted(noremovereqs)))
 
     noaddreqs = (newreqs - repo.requirements -
-                 upgradeallowednewrequirements(repo))
+                 allowednewrequirements(repo))
     if noaddreqs:
         raise error.Abort(_('cannot upgrade repository; do not support adding '
                             'requirement: %s') %


More information about the Mercurial-devel mailing list