[PATCH 04 of 15 RFC] verify: rename "hasmanifest" variable for source code readability

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Wed Oct 3 11:39:01 CDT 2012


# HG changeset patch
# User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
# Date 1349281445 -32400
# Node ID 07c423d400694c4ca3bb5a7cadd0e4119d31d4bd
# Parent  057d9aa79019e244bcac55e77dab92a923573739
verify: rename "hasmanifest" variable for source code readability

Before this patch, there are two ambiguous variables: "havemf" and
"hasmanifest".

"havemf" means whether there are any "manifest" entries.

"hasmanifest" means whether there are any "changelog" entries
referring to "manifest" entry.

This patch renames from "hasmanifest" to "refersmf" to clear
difference from "havemf".

diff -r 057d9aa79019 -r 07c423d40069 mercurial/verify.py
--- a/mercurial/verify.py	Thu Oct 04 01:24:05 2012 +0900
+++ b/mercurial/verify.py	Thu Oct 04 01:24:05 2012 +0900
@@ -120,7 +120,7 @@
     havemf = len(mf) > 0
 
     ui.status(_("checking changesets\n"))
-    hasmanifest = False
+    refersmf = False
     seen = {}
     checklog(cl, "changelog", 0)
     total = len(repo)
@@ -133,17 +133,17 @@
             changes = cl.read(n)
             if changes[0] != nullid:
                 mflinkrevs.setdefault(changes[0], []).append(i)
-                hasmanifest = True
+                refersmf = True
             for f in changes[3]:
                 filelinkrevs.setdefault(f, []).append(i)
         except Exception, inst:
-            hasmanifest = True
+            refersmf = True
             exc(i, _("unpacking changeset %s") % short(n), inst)
     ui.progress(_('checking'), None)
 
     ui.status(_("checking manifests\n"))
     seen = {}
-    if hasmanifest:
+    if refersmf:
         # Do not check manifest if there are only changelog entries with
         # null manifests.
         checklog(mf, "manifest", 0)


More information about the Mercurial-devel mailing list