Patchwork [2,of,4,V2] tests: add coverage for preserving 'lfs' requirement on repo upgrade

login
register
mail settings
Submitter Matt Harbison
Date Dec. 10, 2017, 1:57 a.m.
Message ID <174a9429a46635c56e03.1512871029@Envy>
Download mbox | patch
Permalink /patch/26156/
State Accepted
Headers show

Comments

Matt Harbison - Dec. 10, 2017, 1:57 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1512704191 18000
#      Thu Dec 07 22:36:31 2017 -0500
# Node ID 174a9429a46635c56e038def4a1ac87d8d96ba88
# Parent  4b10e004880255c9e8a9cc64fa7f4b85ab2925a8
tests: add coverage for preserving 'lfs' requirement on repo upgrade

The test also shows that the local blob store is erroneously lost.

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
@@ -514,6 +514,70 @@ 
   revlogv1
   store
 
+  $ cat << EOF >> .hg/hgrc
+  > [extensions]
+  > lfs =
+  > [lfs]
+  > threshold = 10
+  > EOF
+  $ echo '123456789012345' > lfs.bin
+  $ hg ci -Am 'lfs.bin'
+  adding lfs.bin
+  $ grep lfs .hg/requires
+  lfs
+  $ find .hg/store/lfs -type f
+  .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
+
+  $ hg debugupgraderepo --run
+  upgrade will perform the following actions:
+  
+  requirements
+     preserved: dotencode, fncache, generaldelta, largefiles, lfs, revlogv1, store
+  
+  beginning upgrade...
+  repository locked and read-only
+  creating temporary repository to stage migrated data: $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
+  (it is safe to interrupt this process any time before data migration completes)
+  migrating 6 total revisions (2 in filelogs, 2 in manifests, 2 in changelog)
+  migrating 417 bytes in store; 467 bytes tracked data
+  migrating 2 filelogs containing 2 revisions (168 bytes in store; 182 bytes tracked data)
+  finished migrating 2 filelog revisions across 2 filelogs; change in size: 0 bytes
+  migrating 1 manifests containing 2 revisions (113 bytes in store; 151 bytes tracked data)
+  finished migrating 2 manifest revisions across 1 manifests; change in size: 0 bytes
+  migrating changelog containing 2 revisions (136 bytes in store; 134 bytes tracked data)
+  finished migrating 2 changelog revisions; change in size: 0 bytes
+  finished migrating 6 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/largefilesrepo/.hg/upgradebackup.* (glob)
+  replacing store...
+  store replacement complete; repository was inconsistent for *s (glob)
+  finalizing requirements file and making repository readable again
+  removing temporary repository $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
+  copy of old repository backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
+  the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
+
+  $ grep lfs .hg/requires
+  lfs
+TODO: restore the local lfs store.  For now, objects are copied from the user
+cache as needed.
+  $ find .hg/store/lfs -type f
+  find: `.hg/store/lfs': $ENOENT$
+  [1]
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  2 files, 2 changesets, 2 total revisions
+  $ hg debugdata lfs.bin 0
+  version https://git-lfs.github.com/spec/v1
+  oid sha256:d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
+  size 16
+  x-is-binary 0
+
   $ cd ..
 
 repository config is taken in account