changeset 38995:ed25722da873

changegroup: move part of _revisiondeltanarrow into group() Now all the logic for determining which delta generation code is called lives in a single function. Differential Revision: https://phab.mercurial-scm.org/D4187
author Gregory Szorc <gregory.szorc@gmail.com>
date Mon, 06 Aug 2018 15:04:20 -0700
parents 6076053589b9
children 5baafb8fe253
files mercurial/changegroup.py
diffstat 1 files changed, 14 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/changegroup.py	Mon Aug 06 14:56:37 2018 -0700
+++ b/mercurial/changegroup.py	Mon Aug 06 15:04:20 2018 -0700
@@ -710,8 +710,19 @@
             linknode = lookup(store.node(curr))
 
             if self._ellipses:
-                delta = self._revisiondeltanarrow(store, ischangelog,
-                                                  curr, prev, linknode)
+                linkrev = self._clnodetorev[linknode]
+                self._clrevtolocalrev[linkrev] = curr
+
+                # This is a node to send in full, because the changeset it
+                # corresponds to was a full changeset.
+                if linknode in self._fullnodes:
+                    delta = _revisiondeltanormal(store, curr, prev, linknode,
+                                                 self._deltaparentfn)
+                elif linkrev not in self._precomputedellipsis:
+                    delta = None
+                else:
+                    delta = self._revisiondeltanarrow(store, ischangelog,
+                                                      curr, linkrev, linknode)
             else:
                 delta = _revisiondeltanormal(store, curr, prev, linknode,
                                              self._deltaparentfn)
@@ -1046,21 +1057,7 @@
                 self._verbosenote(_('%8.i  %s\n') % (size, fname))
         progress.complete()
 
-    def _revisiondeltanarrow(self, store, ischangelog, rev, prev, linknode):
-        linkrev = self._clnodetorev[linknode]
-        self._clrevtolocalrev[linkrev] = rev
-
-        # This is a node to send in full, because the changeset it
-        # corresponds to was a full changeset.
-        if linknode in self._fullnodes:
-            return _revisiondeltanormal(store, rev, prev, linknode,
-                                        self._deltaparentfn)
-
-        # At this point, a node can either be one we should skip or an
-        # ellipsis. If it's not an ellipsis, bail immediately.
-        if linkrev not in self._precomputedellipsis:
-            return
-
+    def _revisiondeltanarrow(self, store, ischangelog, rev, linkrev, linknode):
         linkparents = self._precomputedellipsis[linkrev]
         def local(clrev):
             """Turn a changelog revnum into a local revnum.