Patchwork D2244: histedit: binascii.unhexlify (aka node.bin) throws new exception type on py3

login
register
mail settings
Submitter phabricator
Date Feb. 14, 2018, 5:54 a.m.
Message ID <306804d54405493ee361218ce970edbd@localhost.localdomain>
Download mbox | patch
Permalink /patch/27883/
State Not Applicable
Headers show

Comments

phabricator - Feb. 14, 2018, 5:54 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG88dd15b38bb0: histedit: binascii.unhexlify (aka node.bin) throws new exception type on py3 (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2244?vs=5668&id=5688

REVISION DETAIL
  https://phab.mercurial-scm.org/D2244

AFFECTED FILES
  hgext/histedit.py

CHANGE DETAILS




To: durin42, #hg-reviewers, indygreg
Cc: indygreg, mercurial-devel

Patch

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -183,6 +183,7 @@ 
 
 from __future__ import absolute_import
 
+import binascii
 import errno
 import os
 
@@ -425,7 +426,7 @@ 
         rulehash = rule.strip().split(' ', 1)[0]
         try:
             rev = node.bin(rulehash)
-        except TypeError:
+        except (TypeError, binascii.Error):
             raise error.ParseError("invalid changeset %s" % rulehash)
         return cls(state, rev)