<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Fri, Jan 22, 2016 at 5:17 PM Martin von Zweigbergk <<a href="mailto:martinvonz@google.com">martinvonz@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">This will conflict with my changes already on the clowncopter, but simply concatenating the hunks will work. Sorry about the trouble.</div><br><div class="gmail_quote"><div dir="ltr">On Fri, Jan 22, 2016 at 5:16 PM Martin von Zweigbergk <<a href="mailto:martinvonz@google.com" target="_blank">martinvonz@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"># HG changeset patch<br>
# User Martin von Zweigbergk <<a href="mailto:martinvonz@google.com" target="_blank">martinvonz@google.com</a>><br>
# Date 1453509110 28800<br>
#      Fri Jan 22 16:31:50 2016 -0800<br>
# Branch stable<br>
# Node ID 4aabe694f4ee90ac9000adbf9cae2b328cd4ec6d<br>
# Parent  4c6053a6b17d682b34fb88bbeb5e94ed9085d900<br>
exchange: set 'treemanifest' param on pushed changegroups too<br>
<br>
In 5c0fd878779c (treemanifests: set bundle2 part parameter indicating<br>
treemanifest, 2016-01-08), I didn't realize I had to set the parameter<br>
separately for getbundle and unbundle. Having the parameter there on<br>
push allows us to push to an empty repo and have the requirements<br>
updated correctly.<br>
<br>
diff --git a/mercurial/exchange.py b/mercurial/exchange.py<br>
--- a/mercurial/exchange.py<br>
+++ b/mercurial/exchange.py<br>
@@ -717,6 +717,8 @@<br>
     cgpart = bundler.newpart('changegroup', data=cg)<br>
     if version is not None:<br>
         cgpart.addparam('version', version)<br>
+    if 'treemanifest' in pushop.repo.requirements:<br>
+        cgpart.addparam('treemanifest', '1')<br>
     def handlereply(op):<br>
         """extract addchangegroup returns from server reply"""<br>
         cgreplies = op.records.getreplies(<a href="http://cgpart.id" rel="noreferrer" target="_blank">cgpart.id</a>)<br>
diff --git a/tests/test-treemanifest.t b/tests/test-treemanifest.t<br>
--- a/tests/test-treemanifest.t<br>
+++ b/tests/test-treemanifest.t<br>
@@ -285,6 +285,26 @@<br>
        1       127     111      0       5 25ecb8cb8618 000000000000 000000000000<br>
        2       238      55      1       6 5b16163a30c6 25ecb8cb8618 000000000000<br>
<br>
+Pushing from treemanifest repo to an empty repo makes that a treemanifest repo<br>
+<br>
+  $ cd ..<br>
+  $ hg init empty-repo<br>
+  $ cat << EOF >> empty-repo/.hg/hgrc<br>
+  > [experimental]<br>
+  > changegroup3=yes<br>
+  > EOF<br>
+  $ grep treemanifest empty-repo/.hg/requires<br>
+  [1]<br>
+  $ hg push -R repo -r 0 empty-repo<br>
+  pushing to empty-repo<br>
+  searching for changes<br>
+  adding changesets<br>
+  adding manifests<br>
+  adding file changes<br>
+  added 1 changesets with 2 changes to 2 files<br>
+  $ grep treemanifest empty-repo/.hg/requires<br>
+  treemanifest<br>
+<br>
 Create deeper repo with tree manifests.<br>
<br>
   $ cd ..<br></blockquote></div></blockquote><div><br></div><div>...and this last line in the context should have been removed (unrelated to the conflict). It's probably best if I just resend when my clowncopter patches have landed in Matt's repo.</div></div></div>