indygreg updated this revision to Diff 8132.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3293?vs=8086&id=8132

REVISION DETAIL
  https://phab.mercurial-scm.org/D3293

AFFECTED FILES
  mercurial/bundlerepo.py

CHANGE DETAILS

diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py
--- a/mercurial/bundlerepo.py
+++ b/mercurial/bundlerepo.py
@@ -492,9 +492,9 @@
     def release(self):
         raise NotImplementedError
 
-def getremotechanges(ui, repo, other, onlyheads=None, bundlename=None,
+def getremotechanges(ui, repo, peer, onlyheads=None, bundlename=None,
                      force=False):
-    '''obtains a bundle of changes incoming from other
+    '''obtains a bundle of changes incoming from peer
 
     "onlyheads" restricts the returned changes to those reachable from the
       specified heads.
@@ -507,62 +507,62 @@
 
     "local" is a local repo from which to obtain the actual incoming
       changesets; it is a bundlerepo for the obtained bundle when the
-      original "other" is remote.
+      original "peer" is remote.
     "csets" lists the incoming changeset node ids.
     "cleanupfn" must be called without arguments when you're done processing
-      the changes; it closes both the original "other" and the one returned
+      the changes; it closes both the original "peer" and the one returned
       here.
     '''
-    tmp = discovery.findcommonincoming(repo, other, heads=onlyheads,
+    tmp = discovery.findcommonincoming(repo, peer, heads=onlyheads,
                                        force=force)
     common, incoming, rheads = tmp
     if not incoming:
         try:
             if bundlename:
                 os.unlink(bundlename)
         except OSError:
             pass
-        return repo, [], other.close
+        return repo, [], peer.close
 
     commonset = set(common)
     rheads = [x for x in rheads if x not in commonset]
 
     bundle = None
     bundlerepo = None
-    localrepo = other.local()
+    localrepo = peer.local()
     if bundlename or not localrepo:
-        # create a bundle (uncompressed if other repo is not local)
+        # create a bundle (uncompressed if peer repo is not local)
 
         # developer config: devel.legacy.exchange
         legexc = ui.configlist('devel', 'legacy.exchange')
         forcebundle1 = 'bundle2' not in legexc and 'bundle1' in legexc
         canbundle2 = (not forcebundle1
-                      and other.capable('getbundle')
-                      and other.capable('bundle2'))
+                      and peer.capable('getbundle')
+                      and peer.capable('bundle2'))
         if canbundle2:
             kwargs = {}
             kwargs[r'common'] = common
             kwargs[r'heads'] = rheads
             kwargs[r'bundlecaps'] = exchange.caps20to10(repo, role='client')
             kwargs[r'cg'] = True
-            b2 = other.getbundle('incoming', **kwargs)
+            b2 = peer.getbundle('incoming', **kwargs)
             fname = bundle = changegroup.writechunks(ui, b2._forwardchunks(),
                                                      bundlename)
         else:
-            if other.capable('getbundle'):
-                cg = other.getbundle('incoming', common=common, heads=rheads)
-            elif onlyheads is None and not other.capable('changegroupsubset'):
+            if peer.capable('getbundle'):
+                cg = peer.getbundle('incoming', common=common, heads=rheads)
+            elif onlyheads is None and not peer.capable('changegroupsubset'):
                 # compat with older servers when pulling all remote heads
 
-                with other.commandexecutor() as e:
+                with peer.commandexecutor() as e:
                     cg = e.callcommand('changegroup', {
                         'nodes': incoming,
                         'source': 'incoming',
                     }).result()
 
                 rheads = None
             else:
-                with other.commandexecutor() as e:
+                with peer.commandexecutor() as e:
                     cg = e.callcommand('changegroupsubset', {
                         'bases': incoming,
                         'heads': rheads,
@@ -582,7 +582,7 @@
             # use the created uncompressed bundlerepo
             localrepo = bundlerepo = bundlerepository(repo.baseui, repo.root,
                                                       fname)
-            # this repo contains local and other now, so filter out local again
+            # this repo contains local and peer now, so filter out local again
             common = repo.heads()
     if localrepo:
         # Part of common may be remotely filtered
@@ -594,17 +594,17 @@
 
     if bundlerepo:
         reponodes = [ctx.node() for ctx in bundlerepo[bundlerepo.firstnewrev:]]
-        remotephases = other.listkeys('phases')
+        remotephases = peer.listkeys('phases')
 
-        pullop = exchange.pulloperation(bundlerepo, other, heads=reponodes)
+        pullop = exchange.pulloperation(bundlerepo, peer, heads=reponodes)
         pullop.trmanager = bundletransactionmanager()
         exchange._pullapplyphases(pullop, remotephases)
 
     def cleanup():
         if bundlerepo:
             bundlerepo.close()
         if bundle:
             os.unlink(bundle)
-        other.close()
+        peer.close()
 
     return (localrepo, csets, cleanup)



To: indygreg, #hg-reviewers
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to