Show More
@@ -203,10 +203,10 b' pypats = [' | |||
|
203 | 203 | (r'(?i)descendent', "the proper spelling is descendAnt"), |
|
204 | 204 | (r'\.debug\(\_', "don't mark debug messages for translation"), |
|
205 | 205 | (r'\.strip\(\)\.split\(\)', "no need to strip before splitting"), |
|
206 | (r'^\s*except\s*:', "warning: naked except clause", r'#.*re-raises'), | |
|
206 | 207 | ], |
|
207 | 208 | # warnings |
|
208 | 209 | [ |
|
209 | (r'^\s*except\s*:', "warning: naked except clause"), | |
|
210 | 210 | (r'ui\.(status|progress|write|note|warn)\([\'\"]x', |
|
211 | 211 | "warning: unwrapped ui message"), |
|
212 | 212 | ] |
@@ -355,7 +355,13 b' def checkfile(f, logfunc=_defaultlogger.' | |||
|
355 | 355 | |
|
356 | 356 | prelines = None |
|
357 | 357 | errors = [] |
|
358 |
for p |
|
|
358 | for pat in pats: | |
|
359 | if len(pat) == 3: | |
|
360 | p, msg, ignore = pat | |
|
361 | else: | |
|
362 | p, msg = pat | |
|
363 | ignore = None | |
|
364 | ||
|
359 | 365 | # fix-up regexes for multiline searches |
|
360 | 366 | po = p |
|
361 | 367 | # \s doesn't match \n |
@@ -386,6 +392,8 b' def checkfile(f, logfunc=_defaultlogger.' | |||
|
386 | 392 | print "Skipping %s for %s:%s (check-code -ignore)" % ( |
|
387 | 393 | name, f, n) |
|
388 | 394 | continue |
|
395 | elif ignore and re.search(ignore, l, re.MULTILINE): | |
|
396 | continue | |
|
389 | 397 | bd = "" |
|
390 | 398 | if blame: |
|
391 | 399 | bd = 'working directory' |
@@ -240,7 +240,7 b' def shrink(ui, repo, **opts):' | |||
|
240 | 240 | writerevs(ui, r1, r2, order, tr) |
|
241 | 241 | report(ui, r1, r2) |
|
242 | 242 | tr.close() |
|
243 | except: | |
|
243 | except: # re-raises | |
|
244 | 244 | # Abort transaction first, so we truncate the files before |
|
245 | 245 | # deleting them. |
|
246 | 246 | tr.abort() |
@@ -712,7 +712,7 b' class queue(object):' | |||
|
712 | 712 | tr.close() |
|
713 | 713 | self.savedirty() |
|
714 | 714 | return 2, repo.dirstate.p1() |
|
715 | except: | |
|
715 | except: # re-raises | |
|
716 | 716 | try: |
|
717 | 717 | tr.abort() |
|
718 | 718 | finally: |
@@ -1077,7 +1077,7 b' class queue(object):' | |||
|
1077 | 1077 | r = self.qrepo() |
|
1078 | 1078 | if r: |
|
1079 | 1079 | r[None].add([patchfn]) |
|
1080 | except: | |
|
1080 | except: # re-raises | |
|
1081 | 1081 | repo.rollback() |
|
1082 | 1082 | raise |
|
1083 | 1083 | except Exception: |
@@ -1303,7 +1303,7 b' class queue(object):' | |||
|
1303 | 1303 | else: |
|
1304 | 1304 | ret = self.apply(repo, s, list, all_files=all_files, |
|
1305 | 1305 | tobackup=tobackup, check=check) |
|
1306 | except: | |
|
1306 | except: # re-raises | |
|
1307 | 1307 | self.ui.warn(_('cleaning up working directory...')) |
|
1308 | 1308 | node = repo.dirstate.p1() |
|
1309 | 1309 | hg.revert(repo, node, None) |
@@ -1629,7 +1629,7 b' class queue(object):' | |||
|
1629 | 1629 | self.applieddirty = True |
|
1630 | 1630 | self.strip(repo, [top], update=False, |
|
1631 | 1631 | backup='strip') |
|
1632 | except: | |
|
1632 | except: # re-raises | |
|
1633 | 1633 | repo.dirstate.invalidate() |
|
1634 | 1634 | raise |
|
1635 | 1635 | |
@@ -1643,7 +1643,7 b' class queue(object):' | |||
|
1643 | 1643 | # only write patch after a successful commit |
|
1644 | 1644 | patchf.close() |
|
1645 | 1645 | self.applied.append(statusentry(n, patchfn)) |
|
1646 | except: | |
|
1646 | except: # re-raises | |
|
1647 | 1647 | ctx = repo[cparents[0]] |
|
1648 | 1648 | repo.dirstate.rebuild(ctx.node(), ctx.manifest()) |
|
1649 | 1649 | self.savedirty() |
@@ -3775,7 +3775,7 b' def import_(ui, repo, patch1=None, *patc' | |||
|
3775 | 3775 | tr.close() |
|
3776 | 3776 | if msgs: |
|
3777 | 3777 | repo.savecommitmessage('\n* * *\n'.join(msgs)) |
|
3778 | except: | |
|
3778 | except: # re-raises | |
|
3779 | 3779 | # wlock.release() indirectly calls dirstate.write(): since |
|
3780 | 3780 | # we're crashing, we do not want to change the working dir |
|
3781 | 3781 | # parent after all, so make sure it writes nothing |
@@ -88,7 +88,7 b' def _runcatch(req):' | |||
|
88 | 88 | return _dispatch(req) |
|
89 | 89 | finally: |
|
90 | 90 | ui.flush() |
|
91 | except: | |
|
91 | except: # re-raises | |
|
92 | 92 | # enter the debugger when we hit an exception |
|
93 | 93 | if '--debugger' in req.args: |
|
94 | 94 | traceback.print_exc() |
@@ -204,7 +204,7 b' def _runcatch(req):' | |||
|
204 | 204 | return inst.code |
|
205 | 205 | except socket.error, inst: |
|
206 | 206 | ui.warn(_("abort: %s\n") % inst.args[-1]) |
|
207 | except: | |
|
207 | except: # re-raises | |
|
208 | 208 | ui.warn(_("** unknown exception encountered," |
|
209 | 209 | " please report by visiting\n")) |
|
210 | 210 | ui.warn(_("** http://mercurial.selenic.com/wiki/BugTracker\n")) |
@@ -203,7 +203,7 b' def copystore(ui, srcrepo, destpath):' | |||
|
203 | 203 | else: |
|
204 | 204 | ui.debug("copied %d files\n" % num) |
|
205 | 205 | return destlock |
|
206 | except: | |
|
206 | except: # re-raises | |
|
207 | 207 | release(destlock) |
|
208 | 208 | raise |
|
209 | 209 |
@@ -290,7 +290,7 b' class KeepAliveHandler(object):' | |||
|
290 | 290 | # worked. We'll check the version below, too. |
|
291 | 291 | except (socket.error, httplib.HTTPException): |
|
292 | 292 | r = None |
|
293 | except: | |
|
293 | except: # re-raises | |
|
294 | 294 | # adding this block just in case we've missed |
|
295 | 295 | # something we will still raise the exception, but |
|
296 | 296 | # lets try and close the connection and remove it |
@@ -1180,7 +1180,7 b' class localrepository(repo.repository):' | |||
|
1180 | 1180 | self.hook("precommit", throw=True, parent1=hookp1, |
|
1181 | 1181 | parent2=hookp2) |
|
1182 | 1182 | ret = self.commitctx(cctx, True) |
|
1183 | except: | |
|
1183 | except: # re-raises | |
|
1184 | 1184 | if edited: |
|
1185 | 1185 | self.ui.write( |
|
1186 | 1186 | _('note: commit message saved in %s\n') % msgfn) |
@@ -245,7 +245,7 b' def extract(ui, fileobj):' | |||
|
245 | 245 | tmpfp.write('\n') |
|
246 | 246 | elif not diffs_seen and message and content_type == 'text/plain': |
|
247 | 247 | message += '\n' + payload |
|
248 | except: | |
|
248 | except: # re-raises | |
|
249 | 249 | tmpfp.close() |
|
250 | 250 | os.unlink(tmpname) |
|
251 | 251 | raise |
@@ -131,7 +131,7 b' def strip(ui, repo, nodelist, backup="al' | |||
|
131 | 131 | file, troffset, ignore = tr.entries[i] |
|
132 | 132 | repo.sopener(file, 'a').truncate(troffset) |
|
133 | 133 | tr.close() |
|
134 | except: | |
|
134 | except: # re-raises | |
|
135 | 135 | tr.abort() |
|
136 | 136 | raise |
|
137 | 137 | |
@@ -160,7 +160,7 b' def strip(ui, repo, nodelist, backup="al' | |||
|
160 | 160 | for m in updatebm: |
|
161 | 161 | bm[m] = repo['.'].node() |
|
162 | 162 | bookmarks.write(repo) |
|
163 | except: | |
|
163 | except: # re-raises | |
|
164 | 164 | if backupfile: |
|
165 | 165 | ui.warn(_("strip failed, full bundle stored in '%s'\n") |
|
166 | 166 | % backupfile) |
@@ -760,7 +760,7 b' def mktempcopy(name, emptyok=False, crea' | |||
|
760 | 760 | ofp.write(chunk) |
|
761 | 761 | ifp.close() |
|
762 | 762 | ofp.close() |
|
763 | except: | |
|
763 | except: # re-raises | |
|
764 | 764 | try: os.unlink(temp) |
|
765 | 765 | except OSError: pass |
|
766 | 766 | raise |
@@ -8,9 +8,6 b'' | |||
|
8 | 8 | $ hg manifest | xargs "$check_code" || echo 'FAILURE IS NOT AN OPTION!!!' |
|
9 | 9 | |
|
10 | 10 | $ hg manifest | xargs "$check_code" --warnings --nolineno --per-file=0 || true |
|
11 | contrib/shrink-revlog.py:0: | |
|
12 | > except: | |
|
13 | warning: naked except clause | |
|
14 | 11 | hgext/convert/cvsps.py:0: |
|
15 | 12 | > ui.write('Ancestors: %s\n' % (','.join(r))) |
|
16 | 13 | warning: unwrapped ui message |
@@ -69,15 +66,6 b'' | |||
|
69 | 66 | > ui.note("hg ci -m '%s'\n" % msg) |
|
70 | 67 | warning: unwrapped ui message |
|
71 | 68 | hgext/mq.py:0: |
|
72 | > except: | |
|
73 | warning: naked except clause | |
|
74 | hgext/mq.py:0: | |
|
75 | > except: | |
|
76 | warning: naked except clause | |
|
77 | warning: naked except clause | |
|
78 | warning: naked except clause | |
|
79 | warning: naked except clause | |
|
80 | hgext/mq.py:0: | |
|
81 | 69 | > ui.write("mq: %s\n" % ', '.join(m)) |
|
82 | 70 | warning: unwrapped ui message |
|
83 | 71 | hgext/patchbomb.py:0: |
@@ -117,9 +105,6 b'' | |||
|
117 | 105 | > ui.write('deltas against p2 : ' + fmt % pcfmt(nump2, numdeltas)) |
|
118 | 106 | warning: unwrapped ui message |
|
119 | 107 | mercurial/commands.py:0: |
|
120 | > except: | |
|
121 | warning: naked except clause | |
|
122 | mercurial/commands.py:0: | |
|
123 | 108 | > ui.write("common heads: %s\n" % " ".join([short(n) for n in common])) |
|
124 | 109 | warning: unwrapped ui message |
|
125 | 110 | mercurial/commands.py:0: |
@@ -177,33 +162,6 b'' | |||
|
177 | 162 | mercurial/commands.py:0: |
|
178 | 163 | > ui.write('symlink: %s\n' % (util.checklink(path) and 'yes' or 'no')) |
|
179 | 164 | warning: unwrapped ui message |
|
180 | mercurial/dispatch.py:0: | |
|
181 | > except: | |
|
182 | warning: naked except clause | |
|
183 | mercurial/dispatch.py:0: | |
|
184 | > except: | |
|
185 | warning: naked except clause | |
|
186 | mercurial/hg.py:0: | |
|
187 | > except: | |
|
188 | warning: naked except clause | |
|
189 | mercurial/keepalive.py:0: | |
|
190 | > except: | |
|
191 | warning: naked except clause | |
|
192 | mercurial/localrepo.py:0: | |
|
193 | > except: | |
|
194 | warning: naked except clause | |
|
195 | mercurial/patch.py:0: | |
|
196 | > except: | |
|
197 | warning: naked except clause | |
|
198 | mercurial/repair.py:0: | |
|
199 | > except: | |
|
200 | warning: naked except clause | |
|
201 | mercurial/repair.py:0: | |
|
202 | > except: | |
|
203 | warning: naked except clause | |
|
204 | mercurial/util.py:0: | |
|
205 | > except: | |
|
206 | warning: naked except clause | |
|
207 | 165 | tests/autodiff.py:0: |
|
208 | 166 | > ui.write('data lost for: %s\n' % fn) |
|
209 | 167 | warning: unwrapped ui message |
General Comments 0
You need to be logged in to leave comments.
Login now