hiddenhash: fix centos6 build

Summary:
To get rid of this DeprecationWarning:

    --- /data/hgbuild/facebook-hg-rpms/fb-hgext/tests/test-hiddenhash.t
    +++ /data/hgbuild/facebook-hg-rpms/fb-hgext/tests/test-hiddenhash.t.err
    @@ -10,5 +10,7 @@
       $ hg debugbuilddag +1
       $ hg debugobsolete 1ea73414a91b0920940797d8fc6a11e447f8ea1e
       $ hg log -r 0
    +  $TESTTMP/hiddenhash.py:33: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
    +    match = re.match(r"hidden revision '(\d+)'", e.message)
       abort: hidden changeset 1ea73414a91b!
       [255]


let's not access `.message` and use str(e) instead

Test Plan:
arc unit,
Will test on centos6 soon

Reviewers: #sourcecontrol, simonfar

Reviewed By: simonfar

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D4521398

Signature: t1:4521398:1486470861:e39e4639346d0f1f2e4a69fc38ccf34fbc432df6
This commit is contained in:
Stanislau Hlebik 2017-02-07 04:51:20 -08:00
parent c4a1147f39
commit e553fcf9af

View File

@ -30,7 +30,7 @@ def _wrapchangectx(orig, repo, *args, **kwargs):
try:
return orig(repo, *args, **kwargs)
except error.FilteredRepoLookupError as e:
match = re.match(r"hidden revision '(\d+)'", e.message)
match = re.match(r"hidden revision '(\d+)'", str(e))
if not match:
raise
rev = int(match.group(1))