From patchwork Mon Apr 10 16:48:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [02, of, 11] upgrade: drop the prefix to the 'requiredsourcerequirements' function From: Pierre-Yves David X-Patchwork-Id: 20079 Message-Id: <87d0810204a070cc3c6e.1491842933@nodosa.octopoid.net> To: mercurial-devel@mercurial-scm.org Cc: Gregory Szorc Date: Mon, 10 Apr 2017 18:48:53 +0200 # HG changeset patch # User Pierre-Yves David # 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. 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)))