hg.clone: set 'stream' depending on whether --pull was requested or not
authorSiddharth Agarwal <sid0@fb.com>
Fri, 12 Dec 2014 14:02:56 -0800
changeset 23545 68c434799559
parent 23544 7cc0fb0080b6
child 23546 deabbe7ed54b
hg.clone: set 'stream' depending on whether --pull was requested or not In an upcoming patch we'll differentiate between the two in localrepo.
mercurial/hg.py
--- 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,