verify: make the `warn` method private
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 06 Mar 2019 11:24:40 +0100
changeset 41862 c66037fb1bc5
parent 41861 a58748300e61
child 41863 9534f3cb6b6c
verify: make the `warn` method private The method is for internal use only. Let us make that fact clearer.
mercurial/verify.py
--- a/mercurial/verify.py	Wed Mar 06 11:23:05 2019 +0100
+++ b/mercurial/verify.py	Wed Mar 06 11:24:40 2019 +0100
@@ -51,7 +51,7 @@
         self.skipflags = repo.ui.configint('verify', 'skipflags')
         self.warnorphanstorefiles = True
 
-    def warn(self, msg):
+    def _warn(self, msg):
         """record a "warning" level issue"""
         self.ui.warn(msg + "\n")
         self.warnings += 1
@@ -87,9 +87,9 @@
 
         if obj.version != revlog.REVLOGV0:
             if not self.revlogv1:
-                self.warn(_("warning: `%s' uses revlog format 1") % name)
+                self._warn(_("warning: `%s' uses revlog format 1") % name)
         elif self.revlogv1:
-            self.warn(_("warning: `%s' uses revlog format 0") % name)
+            self._warn(_("warning: `%s' uses revlog format 0") % name)
 
     def checkentry(self, obj, i, node, seen, linkrevs, f):
         lr = obj.linkrev(obj.rev(node))
@@ -107,8 +107,8 @@
                                     if self.lrugetctx(l)[f].filenode() == node]
                     except Exception:
                         pass
-                self.warn(_(" (expected %s)") % " ".join
-                          (map(pycompat.bytestr, linkrevs)))
+                self._warn(_(" (expected %s)") % " ".join
+                           (map(pycompat.bytestr, linkrevs)))
             lr = None # can't be trusted
 
         try:
@@ -293,7 +293,7 @@
             subdirprogress.complete()
             if self.warnorphanstorefiles:
                 for f in sorted(storefiles):
-                    self.warn(_("warning: orphan data file '%s'") % f)
+                    self._warn(_("warning: orphan data file '%s'") % f)
 
         return filenodes
 
@@ -376,7 +376,7 @@
                     storefiles.remove(ff)
                 except KeyError:
                     if self.warnorphanstorefiles:
-                        self.warn(_(" warning: revlog '%s' not in fncache!") %
+                        self._warn(_(" warning: revlog '%s' not in fncache!") %
                                   ff)
                         self.fncachewarned = True
 
@@ -392,7 +392,7 @@
                         linkrev = None
 
                     if problem.warning:
-                        self.warn(problem.warning)
+                        self._warn(problem.warning)
                     elif problem.error:
                         self.err(linkrev if linkrev is not None else lr,
                                  problem.error, f)
@@ -425,7 +425,7 @@
                         if lr is not None and ui.verbose:
                             ctx = lrugetctx(lr)
                             if not any(rp[0] in pctx for pctx in ctx.parents()):
-                                self.warn(_("warning: copy source of '%s' not"
+                                self._warn(_("warning: copy source of '%s' not"
                                             " in parents of %s") % (f, ctx))
                         fl2 = repo.file(rp[0])
                         if not len(fl2):
@@ -450,6 +450,6 @@
 
         if self.warnorphanstorefiles:
             for f in sorted(storefiles):
-                self.warn(_("warning: orphan data file '%s'") % f)
+                self._warn(_("warning: orphan data file '%s'") % f)
 
         return len(files), revisions