[PATCH 4 of 6] clone: use `exchange.push` instead of `localrepo.push`

Pierre-Yves David pierre-yves.david at ens-lyon.org
Thu Sep 25 13:46:45 CDT 2014


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1411634486 25200
#      Thu Sep 25 01:41:26 2014 -0700
# Node ID 299c97274dae147b286f3162ffc9ac232f31f556
# Parent  df847d3fe4044027e189a290aab75643d99cff0d
clone: use `exchange.push` instead of `localrepo.push`

The later it going away.

diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -9,11 +9,11 @@
 from i18n import _
 from lock import release
 from node import hex, nullid
 import localrepo, bundlerepo, unionrepo, httppeer, sshpeer, statichttprepo
 import bookmarks, lock, util, extensions, error, node, scmutil, phases, url
-import cmdutil, discovery, repoview
+import cmdutil, discovery, repoview, exchange
 import merge as mergemod
 import verify as verifymod
 import errno, os, shutil
 
 def _local(path):
@@ -406,11 +406,11 @@ def clone(ui, peeropts, source, dest=Non
                 revs = [srcpeer.lookup(r) for r in rev]
                 checkout = revs[0]
             if destpeer.local():
                 destpeer.local().clone(srcpeer, heads=revs, stream=stream)
             elif srcrepo:
-                srcrepo.push(destpeer, revs=revs)
+                exchange.push(srcrepo, destpeer, revs=revs)
             else:
                 raise util.Abort(_("clone from remote to remote not supported"))
 
         cleandir = None
 


More information about the Mercurial-devel mailing list