# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1512522627 -19800 # Node ID 773a9a06047cc4214ea48659708fee644629acfb # Parent 0c1aff6d73a792ce2abb47d53d64d7f3f46f7566 clone: add support for storing remotenames while cloning If `experimental.remotenames` is set to True, we store the remotenames in case of `hg pull`. This patch adds that support to clone command also. Differential Revision: https://phab.mercurial-scm.org/D1601 diff -r 0c1aff6d73a7 -r 773a9a06047c mercurial/hg.py --- a/mercurial/hg.py Fri Dec 08 14:20:34 2017 -0800 +++ b/mercurial/hg.py Wed Dec 06 06:40:27 2017 +0530 @@ -31,6 +31,7 @@ merge as mergemod, node, phases, + remotenames, repoview, scmutil, sshpeer, @@ -689,6 +690,9 @@ destrepo.ui.setconfig('paths', 'default', defaulturl, 'clone') + if ui.configbool('experimental', 'remotenames'): + remotenames.pullremotenames(destrepo, srcpeer) + if update: if update is not True: checkout = srcpeer.lookup(update) diff -r 0c1aff6d73a7 -r 773a9a06047c tests/test-remotenames.t --- a/tests/test-remotenames.t Fri Dec 08 14:20:34 2017 -0800 +++ b/tests/test-remotenames.t Wed Dec 06 06:40:27 2017 +0530 @@ -4,6 +4,8 @@ $ cat >> $HGRCPATH << EOF > [alias] > glog = log -G -T '{rev}:{node|short} {desc}' + > [experimental] + > remotenames = True > EOF Making a server repo @@ -46,25 +48,12 @@ -------------------- $ cd .. - $ hg init client - $ cd client - $ cat >> .hg/hgrc << EOF - > [experimental] - > remotenames = True - > EOF - $ hg pull ../server/ - pulling from ../server/ - requesting all changes - adding changesets - adding manifests - adding file changes - added 9 changesets with 9 changes to 9 files (+1 heads) - adding remote bookmark bar - adding remote bookmark foo - new changesets 18d04c59bb5d:3e1487808078 - (run 'hg heads' to see heads) + $ hg clone server client + updating to branch default + 8 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ cd client $ cat .hg/remotenames/bookmarks 0