[PATCH 5 of 5 modernize-streamclone] streamclone: rename and document maybeperformstreamclone()

Gregory Szorc gregory.szorc at gmail.com
Sun Oct 4 13:39:42 CDT 2015


# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1443983668 25200
#      Sun Oct 04 11:34:28 2015 -0700
# Node ID 22f27f7f4ef3933ee604be645ae79f84ca2f5b99
# Parent  d96e7f31d75fe746aa4046ea114f070198d46005
streamclone: rename and document maybeperformstreamclone()

Upcoming patches will introduce bundle2 based streaming clones. Add
"legacy" to the function name and add a docstring clarifying the intent of
the function.

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -954,9 +954,9 @@ def pull(repo, remote, heads=None, force
 
     lock = pullop.repo.lock()
     try:
         pullop.trmanager = transactionmanager(repo, 'pull', remote.url())
-        streamclone.maybeperformstreamclone(pullop)
+        streamclone.maybeperformlegacystreamclone(pullop)
         _pulldiscovery(pullop)
         if _canusebundle2(pullop):
             _pullbundle2(pullop)
         _pullchangeset(pullop)
diff --git a/mercurial/streamclone.py b/mercurial/streamclone.py
--- a/mercurial/streamclone.py
+++ b/mercurial/streamclone.py
@@ -65,9 +65,17 @@ def canperformstreamclone(repo, remote, 
         requirements = streamreqs
 
     return True, requirements
 
-def maybeperformstreamclone(pullop):
+def maybeperformlegacystreamclone(pullop):
+    """Possibly perform a legacy stream clone operation.
+
+    Legacy stream clones are performed as part of pull but before all other
+    operations.
+
+    A legacy stream clone will not be performed if a bundle2 stream clone is
+    supported.
+    """
     repo = pullop.repo
     remote = pullop.remote
 
     r = canperformstreamclone(repo, remote, pullop.heads,


More information about the Mercurial-devel mailing list