Mercurial > public > mercurial-scm > hg
diff hgext/mq.py @ 16705:c2d9ef43ff6c
check-code: ignore naked excepts with a "re-raise" comment
This also promotes the naked except check from a warning to an error.
author | Brodie Rao <brodie@sf.io> |
---|---|
date | Sun, 13 May 2012 13:18:06 +0200 |
parents | d947e1da1259 |
children | 3290e24bb3f0 |
line wrap: on
line diff
--- a/hgext/mq.py Sun May 13 13:17:50 2012 +0200 +++ b/hgext/mq.py Sun May 13 13:18:06 2012 +0200 @@ -712,7 +712,7 @@ tr.close() self.savedirty() return 2, repo.dirstate.p1() - except: + except: # re-raises try: tr.abort() finally: @@ -1077,7 +1077,7 @@ r = self.qrepo() if r: r[None].add([patchfn]) - except: + except: # re-raises repo.rollback() raise except Exception: @@ -1303,7 +1303,7 @@ else: ret = self.apply(repo, s, list, all_files=all_files, tobackup=tobackup, check=check) - except: + except: # re-raises self.ui.warn(_('cleaning up working directory...')) node = repo.dirstate.p1() hg.revert(repo, node, None) @@ -1629,7 +1629,7 @@ self.applieddirty = True self.strip(repo, [top], update=False, backup='strip') - except: + except: # re-raises repo.dirstate.invalidate() raise @@ -1643,7 +1643,7 @@ # only write patch after a successful commit patchf.close() self.applied.append(statusentry(n, patchfn)) - except: + except: # re-raises ctx = repo[cparents[0]] repo.dirstate.rebuild(ctx.node(), ctx.manifest()) self.savedirty()