changeset 39015:ad9eccedb379

changegroup: minor cleanups to deltagroup() Differential Revision: https://phab.mercurial-scm.org/D4212
author Gregory Szorc <gregory.szorc@gmail.com>
date Wed, 08 Aug 2018 15:28:22 -0700
parents d662959dc881
children 39b8277e2115
files mercurial/changegroup.py
diffstat 1 files changed, 10 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/changegroup.py	Wed Aug 08 14:44:48 2018 -0700
+++ b/mercurial/changegroup.py	Wed Aug 08 15:28:22 2018 -0700
@@ -701,25 +701,27 @@
     If units is not None, progress detail will be generated, units specifies
     the type of revlog that is touched (changelog, manifest, etc.).
     """
-    # if we don't have any revisions touched by these changesets, bail
-    if len(revs) == 0:
+    if not revs:
         return
 
     cl = repo.changelog
 
-    # add the parent of the first rev
-    p = store.parentrevs(revs[0])[0]
-    revs.insert(0, p)
+    # Add the parent of the first rev.
+    revs.insert(0, store.parentrevs(revs[0])[0])
 
     # build deltas
     progress = None
     if units is not None:
         progress = repo.ui.makeprogress(_('bundling'), unit=units,
                                         total=(len(revs) - 1))
-    for r in pycompat.xrange(len(revs) - 1):
+
+    for i in pycompat.xrange(len(revs) - 1):
         if progress:
-            progress.update(r + 1)
-        prev, curr = revs[r], revs[r + 1]
+            progress.update(i + 1)
+
+        prev = revs[i]
+        curr = revs[i + 1]
+
         linknode = lookup(store.node(curr))
 
         if ellipses: