treemanifests: fix local clone
authorMartin von Zweigbergk <martinvonz@google.com>
Tue, 02 Feb 2016 17:31:17 -0800
changeset 29955 bb45190a54b754dafa66b24c2414d33401c0596e
parent 29954 ed94b24a3bb2285c8c421b2389f821f88da82a5d
child 29956 fb92927f977526795e9141e02141b589ebac902f
push id175
push usergszorc@mozilla.com
push dateWed, 10 Feb 2016 01:24:28 +0000
treemanifests: fix local clone When doing a local clone with treemanifests, the .hg/store/meta/ directory currently does not get copied. To fix it, all we need to do is to add it to the list of directories to copy.
mercurial/store.py
tests/test-treemanifest.t
--- a/mercurial/store.py
+++ b/mercurial/store.py
@@ -285,17 +285,17 @@ def _calcmode(vfs):
         mode = vfs.stat().st_mode
             # avoid some useless chmods
         if (0o777 & ~util.umask) == (0o777 & mode):
             mode = None
     except OSError:
         mode = None
     return mode
 
-_data = ('data 00manifest.d 00manifest.i 00changelog.d 00changelog.i'
+_data = ('data meta 00manifest.d 00manifest.i 00changelog.d 00changelog.i'
          ' phaseroots obsstore')
 
 class basicstore(object):
     '''base class for local repository stores'''
     def __init__(self, path, vfstype):
         vfs = vfstype(path)
         self.path = vfs.base
         self.createmode = _calcmode(vfs)
@@ -499,17 +499,17 @@ class fncachestore(basicstore):
             ef = self.encode(f)
             try:
                 yield f, ef, self.getsize(ef)
             except OSError as err:
                 if err.errno != errno.ENOENT:
                     raise
 
     def copylist(self):
-        d = ('data dh fncache phaseroots obsstore'
+        d = ('data meta dh fncache phaseroots obsstore'
              ' 00manifest.d 00manifest.i 00changelog.d 00changelog.i')
         return (['requires', '00changelog.i'] +
                 ['store/' + f for f in d.split()])
 
     def write(self, tr):
         self.fncache.write(tr)
 
     def invalidatecaches(self):
--- a/tests/test-treemanifest.t
+++ b/tests/test-treemanifest.t
@@ -508,8 +508,61 @@ Verify passes.
   $ cd deepclone
   $ hg verify
   checking changesets
   checking manifests
   crosschecking files in changesets and manifests
   checking files
   8 files, 3 changesets, 10 total revisions
   $ cd ..
+
+Create clones using old repo formats to use in later tests
+  $ hg clone --config format.usestore=False \
+  >   --config experimental.changegroup3=True \
+  >   http://localhost:$HGPORT2 deeprepo-basicstore
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 10 changes to 8 files
+  updating to branch default
+  8 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ grep store deeprepo-basicstore/.hg/requires
+  [1]
+  $ hg clone --config format.usefncache=False \
+  >   --config experimental.changegroup3=True \
+  >   http://localhost:$HGPORT2 deeprepo-encodedstore
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 10 changes to 8 files
+  updating to branch default
+  8 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ grep fncache deeprepo-encodedstore/.hg/requires
+  [1]
+
+Local clone with basicstore
+  $ hg clone -U deeprepo-basicstore local-clone-basicstore
+  $ hg -R local-clone-basicstore verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  8 files, 3 changesets, 10 total revisions
+
+Local clone with encodedstore
+  $ hg clone -U deeprepo-encodedstore local-clone-encodedstore
+  $ hg -R local-clone-encodedstore verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  8 files, 3 changesets, 10 total revisions
+
+Local clone with fncachestore
+  $ hg clone -U deeprepo local-clone-fncachestore
+  $ hg -R local-clone-fncachestore verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  8 files, 3 changesets, 10 total revisions