changeset 23545:68c434799559

hg.clone: set 'stream' depending on whether --pull was requested or not In an upcoming patch we'll differentiate between the two in localrepo.
author Siddharth Agarwal <sid0@fb.com>
date Fri, 12 Dec 2014 14:02:56 -0800
parents 7cc0fb0080b6
children deabbe7ed54b
files mercurial/hg.py
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hg.py	Fri Nov 14 05:53:04 2014 -0800
+++ b/mercurial/hg.py	Fri Dec 12 14:02:56 2014 -0800
@@ -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,