bundlerepo: bundle repos should be non-publishing (issue3266) stable
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Wed, 29 Feb 2012 14:41:11 +0100
branchstable
changeset 16195 40cc20042fb4
parent 16194 6ba530122d8b
child 16196 8ae7626d8bf1
bundlerepo: bundle repos should be non-publishing (issue3266) Bundle repo contains both the bundle content and the content of the repository used as a base. This create bugs with phases exchange because the "remote" repository claim to contains changeset it does not. The easiest way to fix this bug is to ensure a bundle repo as non publishing. This way changeset will be seen in the same phase than locally. This patch does not alter in which phase bundle revision are seen. For now they are seen as if an old client had add them on the remote: They inherit their phase from parent whatever the parent is. This is to be fixed in a later patch
mercurial/bundlerepo.py
tests/test-phases-exchange.t
--- a/mercurial/bundlerepo.py	Wed Feb 29 09:34:19 2012 +0100
+++ b/mercurial/bundlerepo.py	Wed Feb 29 14:41:11 2012 +0100
@@ -168,6 +168,7 @@
             self._tempparent = tempfile.mkdtemp()
             localrepo.instance(ui, self._tempparent, 1)
             localrepo.localrepository.__init__(self, ui, self._tempparent)
+        self.ui.setconfig('phases', 'publish', False)
 
         if path:
             self._url = 'bundle:' + util.expandpath(path) + '+' + bundlename
--- a/tests/test-phases-exchange.t	Wed Feb 29 09:34:19 2012 +0100
+++ b/tests/test-phases-exchange.t	Wed Feb 29 14:41:11 2012 +0100
@@ -465,6 +465,38 @@
   o  0 public a-A - 054250a37db4
   
 
+Pulling from bundle does not alter phases of changeset not present in the bundle
+
+  $ hg bundle  --base 1 -r 6 -r 3 ../partial-bundle.hg
+  5 changesets found
+  $ hg pull ../partial-bundle.hg
+  pulling from ../partial-bundle.hg
+  searching for changes
+  no changes found
+  $ hgph
+  @  10 draft a-H - 967b449fbc94
+  |
+  | o  9 draft a-G - 3e27b6f1eee1
+  | |
+  | o  8 draft a-F - b740e3e5c05d
+  | |
+  | o  7 draft a-E - e9f537e46dea
+  | |
+  +---o  6 public n-B - 145e75495359
+  | |
+  o |  5 public n-A - d6bcb4f74035
+  | |
+  o |  4 public b-A - f54f1bb90ff3
+  | |
+  | o  3 public a-D - b555f63b6063
+  | |
+  | o  2 public a-C - 54acac6f23ab
+  |/
+  o  1 public a-B - 548a3d25dbf0
+  |
+  o  0 public a-A - 054250a37db4
+  
+
 Pushing to Publish=False (unknown changeset)
 
   $ hg push ../mu -r b740e3e5c05d # a-F