changeset 26458:362793295640

streamclone: refactor maybeperformstreamclone to take a pullop Just like all the other pull steps. Consistency is good. This seems a little excessive right now since maybeperformstreamclone is such a short function. This will be addressed in a subsequent patch.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sun, 04 Oct 2015 11:20:52 -0700
parents 7e81305092a0
children 3b28ffde133a
files mercurial/exchange.py mercurial/streamclone.py
diffstat 2 files changed, 9 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/exchange.py	Sun Oct 04 11:17:43 2015 -0700
+++ b/mercurial/exchange.py	Sun Oct 04 11:20:52 2015 -0700
@@ -964,9 +964,7 @@
     lock = pullop.repo.lock()
     try:
         pullop.trmanager = transactionmanager(repo, 'pull', remote.url())
-        streamclone.maybeperformstreamclone(pullop.repo, pullop.remote,
-                                            pullop.heads,
-                                            pullop.streamclonerequested)
+        streamclone.maybeperformstreamclone(pullop)
         _pulldiscovery(pullop)
         if _canusebundle2(pullop):
             _pullbundle2(pullop)
--- a/mercurial/streamclone.py	Sun Oct 04 11:17:43 2015 -0700
+++ b/mercurial/streamclone.py	Sun Oct 04 11:20:52 2015 -0700
@@ -66,9 +66,14 @@
 
     return True, requirements
 
-def maybeperformstreamclone(repo, remote, heads, stream):
-    supported, requirements = canperformstreamclone(repo, remote, heads,
-                                                     streamrequested=stream)
+def maybeperformstreamclone(pullop):
+    repo = pullop.repo
+    remote = pullop.remote
+
+    r = canperformstreamclone(repo, remote, pullop.heads,
+                              streamrequested=pullop.streamclonerequested)
+    supported, requirements = r
+
     if not supported:
         return