Patchwork D8660: upgrade: support running upgrade if repository has share-safe requirement

login
register
mail settings
Submitter phabricator
Date June 25, 2020, 8:54 a.m.
Message ID <differential-rev-PHID-DREV-n4mqjhzn2on4sqse2wcz-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46562/
State New
Headers show

Comments

phabricator - June 25, 2020, 8:54 a.m.
pulkit created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This helps us in testing changing requirements of source repository and checking
  that the shared repository works.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/upgrade.py
  tests/test-share-safe.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-share-safe.t b/tests/test-share-safe.t
--- a/tests/test-share-safe.t
+++ b/tests/test-share-safe.t
@@ -97,4 +97,32 @@ 
   [ui]
   curses=false
 
+Update the source repository format and check that shared repo works
+
+  $ cd ../source
+  $ echo "[format]" >> .hg/hgrc
+  $ echo "revlog-compression=zstd" >> .hg/hgrc
+
+  $ hg debugupgraderepo --run -q
+  upgrade will perform the following actions:
+  
+  requirements
+     preserved: dotencode, fncache, generaldelta, revlogv1, sharesafe, sparserevlog, store
+     added: revlog-compression-zstd
+  
+  $ hg log -r .
+  changeset:   1:5f6d8a4bf34a
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     added b
+  
+Shared one should work
+  $ cd ../shared1
+  $ hg log -r .
+  changeset:   2:155349b645be
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     added c
+  
   $ hg unshare
diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py
--- a/mercurial/upgrade.py
+++ b/mercurial/upgrade.py
@@ -107,6 +107,7 @@ 
         localrepo.SIDEDATA_REQUIREMENT,
         localrepo.COPIESSDC_REQUIREMENT,
         localrepo.NODEMAP_REQUIREMENT,
+        localrepo.SHARESAFE_REQUIREMENT,
     }
     for name in compression.compengines:
         engine = compression.compengines[name]