changeset 35341:cb7a0ae053c6

upgrade: add a test to show the repository config being ignored The upgrade process ignores the config within the repository. The next changeset fixes it, but we introduce this test before to show it actually tests our target.
author Boris Feld <boris.feld@octobus.net>
date Thu, 07 Dec 2017 20:50:24 +0100
parents ead01b74be04
children 75520786ad2f
files tests/test-upgrade-repo.t
diffstat 1 files changed, 92 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-upgrade-repo.t	Thu Dec 07 16:50:48 2017 +0100
+++ b/tests/test-upgrade-repo.t	Thu Dec 07 20:50:24 2017 +0100
@@ -467,3 +467,95 @@
   largefiles
   revlogv1
   store
+
+  $ cd ..
+
+repository config is taken in account
+-------------------------------------
+
+  $ cat << EOF >> $HGRCPATH
+  > [format]
+  > maxchainlen = 1
+  > EOF
+
+  $ hg init localconfig
+  $ cd localconfig
+  $ cat << EOF > file
+  > some content
+  > with some length
+  > to make sure we get a delta
+  > after changes
+  > very long
+  > very long
+  > very long
+  > very long
+  > very long
+  > very long
+  > very long
+  > very long
+  > very long
+  > very long
+  > very long
+  > EOF
+  $ hg -q commit -A -m A
+  $ echo "new line" >> file
+  $ hg -q commit -m B
+  $ echo "new line" >> file
+  $ hg -q commit -m C
+
+  $ cat << EOF >> .hg/hgrc
+  > [format]
+  > maxchainlen = 9001
+  > EOF
+  $ hg config format
+  format.maxchainlen=9001
+  $ hg debugindex file
+     rev    offset  length  delta linkrev nodeid       p1           p2
+       0         0      77     -1       0 bcc1d3df78b2 000000000000 000000000000
+       1        77      21      0       1 af3e29f7a72e bcc1d3df78b2 000000000000
+       2        98      84     -1       2 8daf79c5522b af3e29f7a72e 000000000000
+
+  $ hg debugupgraderepo --run --optimize redeltaall
+  upgrade will perform the following actions:
+  
+  requirements
+     preserved: dotencode, fncache, generaldelta, revlogv1, store
+  
+  redeltaall
+     deltas within internal storage will be fully recomputed; this will likely drastically slow down execution time
+  
+  beginning upgrade...
+  repository locked and read-only
+  creating temporary repository to stage migrated data: $TESTTMP/localconfig/.hg/upgrade.* (glob)
+  (it is safe to interrupt this process any time before data migration completes)
+  migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
+  migrating 497 bytes in store; 882 bytes tracked data
+  migrating 1 filelogs containing 3 revisions (182 bytes in store; 573 bytes tracked data)
+  finished migrating 3 filelog revisions across 1 filelogs; change in size: 0 bytes
+  migrating 1 manifests containing 3 revisions (141 bytes in store; 138 bytes tracked data)
+  finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
+  migrating changelog containing 3 revisions (174 bytes in store; 171 bytes tracked data)
+  finished migrating 3 changelog revisions; change in size: 0 bytes
+  finished migrating 9 total revisions; total change in store size: 0 bytes
+  copying phaseroots
+  data fully migrated to temporary repository
+  marking source repository as being upgraded; clients will be unable to read from repository
+  starting in-place swap of repository data
+  replaced files will be backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
+  replacing store...
+  store replacement complete; repository was inconsistent for 0.0s
+  finalizing requirements file and making repository readable again
+  removing temporary repository $TESTTMP/localconfig/.hg/upgrade.* (glob)
+  copy of old repository backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
+  the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
+  $ hg debugindex file
+     rev    offset  length  delta linkrev nodeid       p1           p2
+       0         0      77     -1       0 bcc1d3df78b2 000000000000 000000000000
+       1        77      21      0       1 af3e29f7a72e bcc1d3df78b2 000000000000
+       2        98      84     -1       2 8daf79c5522b af3e29f7a72e 000000000000
+  $ cd ..
+
+  $ cat << EOF >> $HGRCPATH
+  > [format]
+  > maxchainlen = 9001
+  > EOF