# HG changeset patch # User Adrian Buehlmann # Date 2012-05-25 12:24:07 # Node ID 0a0cf3f26938ff7a084f2dcc9e59152ac6060e1e # Parent d37d221334be0f662644d14091478ad70e7fa1ca dispatch: tolerate non-standard version strings in tuplever() (issue3470) When developing, we may see non-standard version strings of the form 5d64306f39bb+20120525 which caused tuplever() to raise ValueError: invalid literal for int() with base 10: '5d64306f39bb' and shadowing the real traceback. diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py --- a/mercurial/dispatch.py +++ b/mercurial/dispatch.py @@ -252,8 +252,10 @@ def _runcatch(req): return -1 def tuplever(v): - return tuple([int(i) for i in v.split('.')]) - + try: + return tuple([int(i) for i in v.split('.')]) + except ValueError: + return tuple() def aliasargs(fn, givenargs): args = getattr(fn, 'args', [])