tags: silence cache parsing errors stable
authorMatt Mackall <mpm@selenic.com>
Thu, 28 Apr 2016 15:35:54 -0500
branchstable
changeset 29038 a9dd92c48a1c
parent 29037 b043d7f27a0e
child 29039 e3055b46ed1b
tags: silence cache parsing errors Follow our standard STFU cache-handling pattern
mercurial/tags.py
tests/test-tags.t
--- a/mercurial/tags.py	Sun May 01 00:12:56 2016 -0300
+++ b/mercurial/tags.py	Thu Apr 28 15:35:54 2016 -0500
@@ -16,7 +16,6 @@
 import errno
 import time
 
-from .i18n import _
 from .node import (
     bin,
     hex,
@@ -176,8 +175,8 @@
     hextaglines = util.sortdict()
     count = 0
 
-    def warn(msg):
-        ui.warn(_("%s, line %s: %s\n") % (fn, count, msg))
+    def dbg(msg):
+        ui.debug("%s, line %s: %s\n" % (fn, count, msg))
 
     for nline, line in enumerate(lines):
         count += 1
@@ -186,7 +185,7 @@
         try:
             (nodehex, name) = line.split(" ", 1)
         except ValueError:
-            warn(_("cannot parse entry"))
+            dbg("cannot parse entry")
             continue
         name = name.strip()
         if recode:
@@ -194,7 +193,7 @@
         try:
             nodebin = bin(nodehex)
         except TypeError:
-            warn(_("node '%s' is not well formed") % nodehex)
+            dbg("node '%s' is not well formed" % nodehex)
             continue
 
         # update filetags
--- a/tests/test-tags.t	Sun May 01 00:12:56 2016 -0300
+++ b/tests/test-tags.t	Thu Apr 28 15:35:54 2016 -0500
@@ -262,12 +262,12 @@
   $ hg commit -m "head"
   created new head
 
-  $ hg tags
+  $ hg tags --debug
   .hgtags@75d9f02dfe28, line 2: cannot parse entry
   .hgtags@75d9f02dfe28, line 4: node 'foo' is not well formed
   .hgtags@c4be69a18c11, line 2: node 'x' is not well formed
-  tip                                8:c4be69a18c11
-  first                              0:acb14030fe0a
+  tip                                8:c4be69a18c11e8bc3a5fdbb576017c25f7d84663
+  first                              0:acb14030fe0a21b60322c440ad2d20cf7685a376
   $ hg tip
   changeset:   8:c4be69a18c11
   tag:         tip