clone: explicitly push bookmarks when cloning from local to remote
authorPierre-Yves David <pierre-yves.david@fb.com>
Fri, 26 Sep 2014 15:15:49 -0700
changeset 22647 5b6cd8526d56
parent 22646 d6ecdb8bfa16
child 22648 ef62c66bee1b
clone: explicitly push bookmarks when cloning from local to remote We need to explicitly push all local bookmarks when doing the clone from a local repo to a remote one through ssh. This will let us remove the manual export of bookmarks in clone and rely on the official exchange in push and pull instead.
mercurial/hg.py
tests/test-init.t
--- a/mercurial/hg.py	Fri Sep 26 13:55:53 2014 -0700
+++ b/mercurial/hg.py	Fri Sep 26 15:15:49 2014 -0700
@@ -413,7 +413,8 @@
             if destpeer.local():
                 destpeer.local().clone(srcpeer, heads=revs, stream=stream)
             elif srcrepo:
-                exchange.push(srcrepo, destpeer, revs=revs)
+                exchange.push(srcrepo, destpeer, revs=revs,
+                              bookmarks=srcrepo._bookmarks.keys())
             else:
                 raise util.Abort(_("clone from remote to remote not supported"))
 
--- a/tests/test-init.t	Fri Sep 26 13:55:53 2014 -0700
+++ b/tests/test-init.t	Fri Sep 26 15:15:49 2014 -0700
@@ -220,5 +220,6 @@
   remote: adding manifests
   remote: adding file changes
   remote: added 1 changesets with 1 changes to 1 files
+  exporting bookmark test
   $ hg -R remote-bookmarks bookmarks
      test                      0:08b9e9f63b32