Patchwork [5,of,6] changegroup: rename "dh" to the clearer "deltaheads"

login
register
mail settings
Submitter via Mercurial-devel
Date June 15, 2017, 10:25 p.m.
Message ID <7aeaaaf76de7dc3eb8d2.1497565532@martinvonz.svl.corp.google.com>
Download mbox | patch
Permalink /patch/21417/
State Accepted
Headers show

Comments

via Mercurial-devel - June 15, 2017, 10:25 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1497559674 25200
#      Thu Jun 15 13:47:54 2017 -0700
# Node ID 7aeaaaf76de7dc3eb8d24757ed7fbc1d32671d25
# Parent  83f5bf2b6c94b43d9bf1d61b518c1b75fb8be417
changegroup: rename "dh" to the clearer "deltaheads"

We have a lot of frequently used abbreviations, but this is not one of
them.

Patch

diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py
--- a/mercurial/changegroup.py
+++ b/mercurial/changegroup.py
@@ -349,16 +349,16 @@ 
                 revisions += newrevs
                 files += newfiles
 
-                dh = 0
+                deltaheads = 0
                 if oldheads:
                     heads = cl.heads()
-                    dh = len(heads) - len(oldheads)
+                    deltaheads = len(heads) - len(oldheads)
                     for h in heads:
                         if h not in oldheads and repo[h].closesbranch():
-                            dh -= 1
+                            deltaheads -= 1
                 htext = ""
-                if dh:
-                    htext = _(" (%+d heads)") % dh
+                if deltaheads:
+                    htext = _(" (%+d heads)") % deltaheads
 
                 repo.ui.status(_("added %d changesets"
                                  " with %d changes to %d files%s\n")
@@ -429,10 +429,10 @@ 
         finally:
             repo.ui.flush()
         # never return 0 here:
-        if dh < 0:
-            return dh - 1
+        if deltaheads < 0:
+            return deltaheads - 1
         else:
-            return dh + 1
+            return deltaheads + 1
 
 class cg2unpacker(cg1unpacker):
     """Unpacker for cg2 streams.