Patchwork [02,of,11] upgrade: drop the prefix to the 'requiredsourcerequirements' function

login
register
mail settings
Submitter Pierre-Yves David
Date April 10, 2017, 4:48 p.m.
Message ID <87d0810204a070cc3c6e.1491842933@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/20079/
State Accepted
Headers show

Comments

Pierre-Yves David - April 10, 2017, 4:48 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
# Date 1491839747 -7200
#      Mon Apr 10 17:55:47 2017 +0200
# Node ID 87d0810204a070cc3c6e695c4f1fe8e097b44a51
# Parent  421260c23fe9fb0afaa77bbb8c4d9d32e631d114
# 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 87d0810204a0
upgrade: drop the prefix to the 'requiredsourcerequirements' function

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

Patch

diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py
--- a/mercurial/upgrade.py
+++ b/mercurial/upgrade.py
@@ -22,7 +22,7 @@  from . import (
     vfs as vfsmod,
 )
 
-def upgraderequiredsourcerequirements(repo):
+def requiredsourcerequirements(repo):
     """Obtain requirements required to be present to upgrade a repo.
 
     An upgrade will not be allowed if the repository doesn't have the
@@ -591,7 +591,7 @@  def upgraderepo(ui, repo, run=False, opt
     repo = repo.unfiltered()
 
     # Ensure the repository can be upgraded.
-    missingreqs = upgraderequiredsourcerequirements(repo) - repo.requirements
+    missingreqs = requiredsourcerequirements(repo) - repo.requirements
     if missingreqs:
         raise error.Abort(_('cannot upgrade repository; requirement '
                             'missing: %s') % _(', ').join(sorted(missingreqs)))