Mercurial > hg
comparison mercurial/tags.py @ 29038:a9dd92c48a1c stable
tags: silence cache parsing errors
Follow our standard STFU cache-handling pattern
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Thu, 28 Apr 2016 15:35:54 -0500 |
parents | 8a256cee72c8 |
children | e3055b46ed1b |
comparison
equal
deleted
inserted
replaced
29037:b043d7f27a0e | 29038:a9dd92c48a1c |
---|---|
14 | 14 |
15 import array | 15 import array |
16 import errno | 16 import errno |
17 import time | 17 import time |
18 | 18 |
19 from .i18n import _ | |
20 from .node import ( | 19 from .node import ( |
21 bin, | 20 bin, |
22 hex, | 21 hex, |
23 nullid, | 22 nullid, |
24 short, | 23 short, |
174 | 173 |
175 bintaghist = util.sortdict() | 174 bintaghist = util.sortdict() |
176 hextaglines = util.sortdict() | 175 hextaglines = util.sortdict() |
177 count = 0 | 176 count = 0 |
178 | 177 |
179 def warn(msg): | 178 def dbg(msg): |
180 ui.warn(_("%s, line %s: %s\n") % (fn, count, msg)) | 179 ui.debug("%s, line %s: %s\n" % (fn, count, msg)) |
181 | 180 |
182 for nline, line in enumerate(lines): | 181 for nline, line in enumerate(lines): |
183 count += 1 | 182 count += 1 |
184 if not line: | 183 if not line: |
185 continue | 184 continue |
186 try: | 185 try: |
187 (nodehex, name) = line.split(" ", 1) | 186 (nodehex, name) = line.split(" ", 1) |
188 except ValueError: | 187 except ValueError: |
189 warn(_("cannot parse entry")) | 188 dbg("cannot parse entry") |
190 continue | 189 continue |
191 name = name.strip() | 190 name = name.strip() |
192 if recode: | 191 if recode: |
193 name = recode(name) | 192 name = recode(name) |
194 try: | 193 try: |
195 nodebin = bin(nodehex) | 194 nodebin = bin(nodehex) |
196 except TypeError: | 195 except TypeError: |
197 warn(_("node '%s' is not well formed") % nodehex) | 196 dbg("node '%s' is not well formed" % nodehex) |
198 continue | 197 continue |
199 | 198 |
200 # update filetags | 199 # update filetags |
201 if calcnodelines: | 200 if calcnodelines: |
202 # map tag name to a list of line numbers | 201 # map tag name to a list of line numbers |