Patchwork D9693: downgrade: if a compression is removed, consider that too

login
register
mail settings
Submitter phabricator
Date Jan. 8, 2021, 6:45 p.m.
Message ID <differential-rev-PHID-DREV-q2mrqrby7hrj32e3c5ck-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48004/
State Superseded
Headers show

Comments

phabricator - Jan. 8, 2021, 6:45 p.m.
pulkit created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  For compression format variant, the result of `fromrepo()` and `fromconfig()` is
  not a boolean and we have to actually equate those to find change.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/upgrade_utils/actions.py

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/upgrade_utils/actions.py b/mercurial/upgrade_utils/actions.py
--- a/mercurial/upgrade_utils/actions.py
+++ b/mercurial/upgrade_utils/actions.py
@@ -467,6 +467,12 @@ 
     downgrades = []
 
     for fv in allformatvariant:
+        if fv.name == b'compression':
+            # If there is a compression change between repository
+            # and config, destination repository compression will change
+            # and current compression will be removed.
+            if fv.fromrepo(repo) != fv.fromconfig(repo):
+                downgrades.append(fv)
         # format variant exist in repo but does not exist in new repository
         # config
         if fv.fromrepo(repo) and not fv.fromconfig(repo):