[PATCH 1 of 2] hg.clone: set 'stream' depending on whether --pull was requested or not

Siddharth Agarwal sid0 at fb.com
Fri Dec 12 22:27:02 UTC 2014


# HG changeset patch
# User Siddharth Agarwal <sid0 at fb.com>
# Date 1418421776 28800
#      Fri Dec 12 14:02:56 2014 -0800
# Node ID 7fe7768d79b0021324ac19d4d0a161d709b93ade
# Parent  416c133145ee78c8e83865b7370e185eed69c1be
hg.clone: set 'stream' depending on whether --pull was requested or not

In an upcoming patch we'll differentiate between the two in localrepo.

diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -284,7 +284,8 @@
     dest: URL of destination repository to create (defaults to base
     name of source repository)
 
-    pull: always pull from source repository, even in local case
+    pull: always pull from source repository, even in local case or if the
+    server prefers streaming
 
     stream: stream raw data uncompressed from repository (fast over
     LAN, slow over WAN)
@@ -420,6 +421,11 @@
                 revs = [srcpeer.lookup(r) for r in rev]
                 checkout = revs[0]
             if destpeer.local():
+                if not stream:
+                    if pull:
+                        stream = False
+                    else:
+                        stream = None
                 destpeer.local().clone(srcpeer, heads=revs, stream=stream)
             elif srcrepo:
                 exchange.push(srcrepo, destpeer, revs=revs,


More information about the Mercurial-devel mailing list