[PATCH 3 of 3 STABLE] clone: copy obsolete marker on local clone

Pierre-Yves David pierre-yves.david at ens-lyon.org
Thu Jul 19 14:19:00 CDT 2012


# HG changeset patch
# User Pierre-Yves.David at ens-lyon.org
# Date 1342725079 -7200
# Branch stable
# Node ID d28fd79efcfd49272b3fbb45634a0cb7835a5b7c
# Parent  ca58a884607433c52d2ba41ec63f8c1d43c0952e
clone: copy obsolete marker on local clone

This change add `obsstore` to the list of files copied during clone. Before this
changeset, extinct changeset were copied without their related obsolete marker.

Note: extinct changesets were included by such clone prior to this changeset.
This is still the case now. There is no strong requirement to exclude obsolete
changesets from the clone as long as they remains obsolete after push. Doing so
allows to use hard link clone even if obsolete changesets exist on the source.

diff -r ca58a8846074 -r d28fd79efcfd mercurial/store.py
--- a/mercurial/store.py	Thu Jul 19 21:00:59 2012 +0200
+++ b/mercurial/store.py	Thu Jul 19 21:11:19 2012 +0200
@@ -233,7 +233,7 @@
     return mode
 
 _data = ['data', '00manifest.d', '00manifest.i', '00changelog.d',
-         '00changelog.i', 'phaseroots']
+         '00changelog.i', 'phaseroots', 'obsstore']
 
 class basicstore(object):
     '''base class for local repository stores'''
@@ -412,8 +412,8 @@
             self.fncache.rewrite(existing)
 
     def copylist(self):
-        d = ['data', 'dh', 'fncache', 'phaseroots', '00manifest.d',
-             '00manifest.i', '00changelog.d', '00changelog.i']
+        d = ['data', 'dh', 'fncache', 'phaseroots', 'obsstore',
+             '00manifest.d', '00manifest.i', '00changelog.d', '00changelog.i']
         return (['requires', '00changelog.i'] +
                 ['store/' + f for f in d])
 
diff -r ca58a8846074 -r d28fd79efcfd tests/test-obsolete.t
--- a/tests/test-obsolete.t	Thu Jul 19 21:00:59 2012 +0200
+++ b/tests/test-obsolete.t	Thu Jul 19 21:11:19 2012 +0200
@@ -178,6 +178,53 @@
   ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
   1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
 
+clone support
+(marker are copied and extinct changeset are included to allo hardlink)
+
+  $ hg clone tmpb clone-dest
+  updating to branch default
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg -R clone-dest log -G --hidden
+  @  changeset:   5:5601fb93a350
+  |  tag:         tip
+  |  parent:      1:7c3bad9141dc
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     add new_3_c
+  |
+  | x  changeset:   4:ca819180edb9
+  |/   parent:      1:7c3bad9141dc
+  |    user:        test
+  |    date:        Thu Jan 01 00:00:00 1970 +0000
+  |    summary:     add new_2_c
+  |
+  | x  changeset:   3:cdbce2fbb163
+  |/   parent:      1:7c3bad9141dc
+  |    user:        test
+  |    date:        Thu Jan 01 00:00:00 1970 +0000
+  |    summary:     add new_c
+  |
+  | o  changeset:   2:245bde4270cd
+  |/   user:        test
+  |    date:        Thu Jan 01 00:00:00 1970 +0000
+  |    summary:     add original_c
+  |
+  o  changeset:   1:7c3bad9141dc
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     add b
+  |
+  o  changeset:   0:1f0dee641bb7
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     add a
+  
+  $ hg -R clone-dest debugobsolete
+  245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f 0 {'date': '56 12', 'user': 'test'}
+  cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
+  ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
+  1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
+
 
 Destination repo have existing data
 ---------------------------------------


More information about the Mercurial-devel mailing list