changeset 27648:e72e669dd51f

verify: get rid of some unnecessary local variables Now that all the major functionality has been refactored out, we can delete some unused local variables.
author Durham Goode <durham@fb.com>
date Tue, 05 Jan 2016 17:08:14 -0800
parents 2c2858f3c1bb
children 6446e9b37c8b
files mercurial/verify.py
diffstat 1 files changed, 6 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/verify.py	Tue Jan 05 17:08:14 2016 -0800
+++ b/mercurial/verify.py	Tue Jan 05 17:08:14 2016 -0800
@@ -137,10 +137,8 @@
         mflinkrevs = {}
         filelinkrevs = {}
         filenodes = {}
-        revisions = 0
-        badrevs = self.badrevs
+
         ui = repo.ui
-        cl = repo.changelog
 
         if not repo.url().startswith('file:'):
             raise error.Abort(_("cannot verify bundle or remote repos"))
@@ -148,10 +146,9 @@
         if os.path.exists(repo.sjoin("journal")):
             ui.warn(_("abandoned transaction found - run hg recover\n"))
 
-        revlogv1 = self.revlogv1
-        if ui.verbose or not revlogv1:
+        if ui.verbose or not self.revlogv1:
             ui.status(_("repository uses revlog format %d\n") %
-                           (revlogv1 and 1 or 0))
+                           (self.revlogv1 and 1 or 0))
 
         self._verifychangelog(mflinkrevs, filelinkrevs)
 
@@ -160,10 +157,9 @@
         self._crosscheckfiles(mflinkrevs, filelinkrevs, filenodes)
 
         totalfiles, filerevisions = self._verifyfiles(filenodes, filelinkrevs)
-        revisions += filerevisions
 
         ui.status(_("%d files, %d changesets, %d total revisions\n") %
-                       (totalfiles, len(cl), revisions))
+                       (totalfiles, len(repo.changelog), filerevisions))
         if self.warnings:
             ui.warn(_("%d warnings encountered!\n") % self.warnings)
         if self.fncachewarned:
@@ -171,9 +167,9 @@
                       'corrupt fncache\n'))
         if self.errors:
             ui.warn(_("%d integrity errors encountered!\n") % self.errors)
-            if badrevs:
+            if self.badrevs:
                 ui.warn(_("(first damaged changeset appears to be %d)\n")
-                        % min(badrevs))
+                        % min(self.badrevs))
             return 1
 
     def _verifychangelog(self, mflinkrevs, filelinkrevs):