Patchwork D8427: upgrade: properly filter action depending on planned work

login
register
mail settings
Submitter phabricator
Date April 15, 2020, 8:16 p.m.
Message ID <differential-rev-PHID-DREV-5cdnfzmwh7xj6juwfoii-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46132/
State Superseded
Headers show

Comments

phabricator - April 15, 2020, 8:16 p.m.
marmoute created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8427

AFFECTED FILES
  mercurial/upgrade.py
  tests/test-lfs-serve.t
  tests/test-upgrade-repo.t

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/tests/test-upgrade-repo.t b/tests/test-upgrade-repo.t
--- a/tests/test-upgrade-repo.t
+++ b/tests/test-upgrade-repo.t
@@ -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
   
diff --git a/tests/test-lfs-serve.t b/tests/test-lfs-serve.t
--- a/tests/test-lfs-serve.t
+++ b/tests/test-lfs-serve.t
@@ -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)
diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py
--- a/mercurial/upgrade.py
+++ b/mercurial/upgrade.py
@@ -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)