Patchwork [05,of,11] upgrade: drop the prefix to the 'improvement' class

login
register
mail settings
Submitter Pierre-Yves David
Date April 10, 2017, 4:48 p.m.
Message ID <4e1fbf6c9d18edde1f05.1491842936@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/20077/
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 1491840089 -7200
#      Mon Apr 10 18:01:29 2017 +0200
# Node ID 4e1fbf6c9d18edde1f05e844d43382221bb3a26e
# Parent  3702777e5bc3c0aaad5cad7824d0eb342aad2419
# 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 4e1fbf6c9d18
upgrade: drop the prefix to the 'improvement' class

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
@@ -97,7 +97,7 @@  def upgradeallowednewrequirements(repo):
 deficiency = 'deficiency'
 optimisation = 'optimization'
 
-class upgradeimprovement(object):
+class improvement(object):
     """Represents an improvement that can be made as part of an upgrade.
 
     The following attributes are defined on each instance:
@@ -156,7 +156,7 @@  def upgradefindimprovements(repo):
     # requirements, so let's not bother.
 
     if 'fncache' not in repo.requirements:
-        improvements.append(upgradeimprovement(
+        improvements.append(improvement(
             name='fncache',
             type=deficiency,
             description=_('long and reserved filenames may not work correctly; '
@@ -168,7 +168,7 @@  def upgradefindimprovements(repo):
             fromconfig='fncache' in newreporeqs))
 
     if 'dotencode' not in repo.requirements:
-        improvements.append(upgradeimprovement(
+        improvements.append(improvement(
             name='dotencode',
             type=deficiency,
             description=_('storage of filenames beginning with a period or '
@@ -179,7 +179,7 @@  def upgradefindimprovements(repo):
             fromconfig='dotencode' in newreporeqs))
 
     if 'generaldelta' not in repo.requirements:
-        improvements.append(upgradeimprovement(
+        improvements.append(improvement(
             name='generaldelta',
             type=deficiency,
             description=_('deltas within internal storage are unable to '
@@ -203,7 +203,7 @@  def upgradefindimprovements(repo):
     for rev in cl:
         chainbase = cl.chainbase(rev)
         if chainbase != rev:
-            improvements.append(upgradeimprovement(
+            improvements.append(improvement(
                 name='removecldeltachain',
                 type=deficiency,
                 description=_('changelog storage is using deltas instead of '
@@ -222,7 +222,7 @@  def upgradefindimprovements(repo):
     # These are unconditionally added. There is logic later that figures out
     # which ones to apply.
 
-    improvements.append(upgradeimprovement(
+    improvements.append(improvement(
         name='redeltaparent',
         type=optimisation,
         description=_('deltas within internal storage will be recalculated to '
@@ -235,7 +235,7 @@  def upgradefindimprovements(repo):
         upgrademessage=_('deltas within internal storage will choose a new '
                          'base revision if needed')))
 
-    improvements.append(upgradeimprovement(
+    improvements.append(improvement(
         name='redeltamultibase',
         type=optimisation,
         description=_('deltas within internal storage will be recalculated '
@@ -252,7 +252,7 @@  def upgradefindimprovements(repo):
                          'parents; may slow down execution time '
                          'significantly')))
 
-    improvements.append(upgradeimprovement(
+    improvements.append(improvement(
         name='redeltaall',
         type=optimisation,
         description=_('deltas within internal storage will always be '