upgrade: properly filter action depending on planned work stable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 15 Apr 2020 18:10:19 +0200
branchstable
changeset 44746 c36a3fcfc36b
parent 44745 b4537125eb3c
child 44747 d8b703b8bf70
upgrade: properly filter action depending on planned work The `determineactions` function filters out deficiency that are not scheduled to be fixed by the target repository configuration. However it only did so for requirement we currently support, letting other actions for unsupported requirement through even if the target repo configuration did not request it. As a result the output of the command was easily polluted by experimental feature with no upgrade support. We rework the code to still filter out requirement based action without the faulty filtering. Differential Revision: https://phab.mercurial-scm.org/D8427
mercurial/upgrade.py
tests/test-lfs-serve.t
tests/test-upgrade-repo.t
--- a/mercurial/upgrade.py	Mon Apr 13 18:04:55 2020 +0200
+++ b/mercurial/upgrade.py	Wed Apr 15 18:10:19 2020 +0200
@@ -628,14 +628,12 @@
     """
     newactions = []
 
-    knownreqs = supporteddestrequirements(repo)
-
     for d in deficiencies:
-        name = d.name
+        name = d._requirement
 
         # If the action is a requirement that doesn't show up in the
         # destination requirements, prune the action.
-        if name in knownreqs and name not in destreqs:
+        if name is not None and name not in destreqs:
             continue
 
         newactions.append(d)
--- a/tests/test-lfs-serve.t	Mon Apr 13 18:04:55 2020 +0200
+++ b/tests/test-lfs-serve.t	Wed Apr 15 18:10:19 2020 +0200
@@ -133,12 +133,6 @@
   requirements
      preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
   
-  sidedata
-     Allows storage of extra data alongside a revision.
-  
-  copies-sdc
-     Allows to use more efficient algorithm to deal with copy tracing.
-  
   beginning upgrade...
   repository locked and read-only
   creating temporary repository to stage migrated data: * (glob)
--- a/tests/test-upgrade-repo.t	Mon Apr 13 18:04:55 2020 +0200
+++ b/tests/test-upgrade-repo.t	Wed Apr 15 18:10:19 2020 +0200
@@ -159,12 +159,6 @@
   requirements
      preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
   
-  sidedata
-     Allows storage of extra data alongside a revision.
-  
-  copies-sdc
-     Allows to use more efficient algorithm to deal with copy tracing.
-  
   additional optimizations are available by specifying "--optimize <name>":
   
   re-delta-parent
@@ -189,12 +183,6 @@
   requirements
      preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
   
-  sidedata
-     Allows storage of extra data alongside a revision.
-  
-  copies-sdc
-     Allows to use more efficient algorithm to deal with copy tracing.
-  
   re-delta-parent
      deltas within internal storage will choose a new base revision if needed
   
@@ -219,12 +207,6 @@
   requirements
      preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
   
-  sidedata
-     Allows storage of extra data alongside a revision.
-  
-  copies-sdc
-     Allows to use more efficient algorithm to deal with copy tracing.
-  
   re-delta-parent
      deltas within internal storage will choose a new base revision if needed
   
@@ -332,12 +314,6 @@
   sparserevlog
      Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
   
-  sidedata
-     Allows storage of extra data alongside a revision.
-  
-  copies-sdc
-     Allows to use more efficient algorithm to deal with copy tracing.
-  
   additional optimizations are available by specifying "--optimize <name>":
   
   re-delta-parent
@@ -386,12 +362,6 @@
   sparserevlog
      Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
   
-  sidedata
-     Allows storage of extra data alongside a revision.
-  
-  copies-sdc
-     Allows to use more efficient algorithm to deal with copy tracing.
-  
   additional optimizations are available by specifying "--optimize <name>":
   
   re-delta-parent
@@ -418,12 +388,6 @@
   requirements
      preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
   
-  sidedata
-     Allows storage of extra data alongside a revision.
-  
-  copies-sdc
-     Allows to use more efficient algorithm to deal with copy tracing.
-  
   beginning upgrade...
   repository locked and read-only
   creating temporary repository to stage migrated data: $TESTTMP/modern/.hg/upgrade.* (glob)
@@ -475,12 +439,6 @@
   generaldelta
      repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
   
-  sidedata
-     Allows storage of extra data alongside a revision.
-  
-  copies-sdc
-     Allows to use more efficient algorithm to deal with copy tracing.
-  
   beginning upgrade...
   repository locked and read-only
   creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
@@ -577,12 +535,6 @@
   sparserevlog
      Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
   
-  sidedata
-     Allows storage of extra data alongside a revision.
-  
-  copies-sdc
-     Allows to use more efficient algorithm to deal with copy tracing.
-  
   beginning upgrade...
   repository locked and read-only
   creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
@@ -617,12 +569,6 @@
   requirements
      preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
   
-  sidedata
-     Allows storage of extra data alongside a revision.
-  
-  copies-sdc
-     Allows to use more efficient algorithm to deal with copy tracing.
-  
   re-delta-parent
      deltas within internal storage will choose a new base revision if needed
   
@@ -697,12 +643,6 @@
   requirements
      preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
   
-  sidedata
-     Allows storage of extra data alongside a revision.
-  
-  copies-sdc
-     Allows to use more efficient algorithm to deal with copy tracing.
-  
   re-delta-parent
      deltas within internal storage will choose a new base revision if needed
   
@@ -749,12 +689,6 @@
   requirements
      preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
   
-  sidedata
-     Allows storage of extra data alongside a revision.
-  
-  copies-sdc
-     Allows to use more efficient algorithm to deal with copy tracing.
-  
   re-delta-parent
      deltas within internal storage will choose a new base revision if needed
   
@@ -801,12 +735,6 @@
   requirements
      preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
   
-  sidedata
-     Allows storage of extra data alongside a revision.
-  
-  copies-sdc
-     Allows to use more efficient algorithm to deal with copy tracing.
-  
   re-delta-parent
      deltas within internal storage will choose a new base revision if needed
   
@@ -858,12 +786,6 @@
      preserved: dotencode, fncache, generaldelta, revlogv1, store
      removed: sparserevlog
   
-  sidedata
-     Allows storage of extra data alongside a revision.
-  
-  copies-sdc
-     Allows to use more efficient algorithm to deal with copy tracing.
-  
   re-delta-parent
      deltas within internal storage will choose a new base revision if needed
   
@@ -916,12 +838,6 @@
   sparserevlog
      Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
   
-  sidedata
-     Allows storage of extra data alongside a revision.
-  
-  copies-sdc
-     Allows to use more efficient algorithm to deal with copy tracing.
-  
   re-delta-parent
      deltas within internal storage will choose a new base revision if needed
   
@@ -976,12 +892,6 @@
   requirements
      preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
   
-  sidedata
-     Allows storage of extra data alongside a revision.
-  
-  copies-sdc
-     Allows to use more efficient algorithm to deal with copy tracing.
-  
   beginning upgrade...
   repository locked and read-only
   creating temporary repository to stage migrated data: $TESTTMP/store-filenames/.hg/upgrade.* (glob)
@@ -1013,12 +923,6 @@
   requirements
      preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
   
-  sidedata
-     Allows storage of extra data alongside a revision.
-  
-  copies-sdc
-     Allows to use more efficient algorithm to deal with copy tracing.
-  
   re-delta-fulladd
      each revision will be added as new content to the internal storage; this will likely drastically slow down execution time, but some extensions might need it
   
@@ -1083,12 +987,6 @@
   requirements
      preserved: dotencode, fncache, generaldelta, largefiles, revlogv1, sparserevlog, store
   
-  sidedata
-     Allows storage of extra data alongside a revision.
-  
-  copies-sdc
-     Allows to use more efficient algorithm to deal with copy tracing.
-  
   beginning upgrade...
   repository locked and read-only
   creating temporary repository to stage migrated data: $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
@@ -1142,12 +1040,6 @@
   requirements
      preserved: dotencode, fncache, generaldelta, largefiles, lfs, revlogv1, sparserevlog, store
   
-  sidedata
-     Allows storage of extra data alongside a revision.
-  
-  copies-sdc
-     Allows to use more efficient algorithm to deal with copy tracing.
-  
   beginning upgrade...
   repository locked and read-only
   creating temporary repository to stage migrated data: $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
@@ -1243,12 +1135,6 @@
   requirements
      preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
   
-  sidedata
-     Allows storage of extra data alongside a revision.
-  
-  copies-sdc
-     Allows to use more efficient algorithm to deal with copy tracing.
-  
   re-delta-all
      deltas within internal storage will be fully recomputed; this will likely drastically slow down execution time