diff --git a/hgext/convert/cvsps.py b/hgext/convert/cvsps.py --- a/hgext/convert/cvsps.py +++ b/hgext/convert/cvsps.py @@ -239,12 +239,12 @@ def createlog(ui, directory=None, root=" continue match = re_01.match(line) if match: - raise Exception(match.group(1)) + raise logerror(match.group(1)) match = re_02.match(line) if match: - raise Exception(match.group(2)) + raise logerror(match.group(2)) if re_03.match(line): - raise Exception(line) + raise logerror(line) elif state == 1: # expect 'Working file' (only when using log instead of rlog) diff --git a/mercurial/pure/mpatch.py b/mercurial/pure/mpatch.py --- a/mercurial/pure/mpatch.py +++ b/mercurial/pure/mpatch.py @@ -112,7 +112,7 @@ def patchedsize(orig, delta): outlen += length if bin != binend: - raise Exception("patch cannot be decoded") + raise ValueError("patch cannot be decoded") outlen += orig - last return outlen