comparison mercurial/dispatch.py @ 16839:0a0cf3f26938

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.
author Adrian Buehlmann <adrian@cadifra.com>
date Fri, 25 May 2012 14:24:07 +0200
parents 1c9f58a6c8f1
children 30143c3dd102
comparison
equal deleted inserted replaced
16838:d37d221334be 16839:0a0cf3f26938
250 raise 250 raise
251 251
252 return -1 252 return -1
253 253
254 def tuplever(v): 254 def tuplever(v):
255 return tuple([int(i) for i in v.split('.')]) 255 try:
256 256 return tuple([int(i) for i in v.split('.')])
257 except ValueError:
258 return tuple()
257 259
258 def aliasargs(fn, givenargs): 260 def aliasargs(fn, givenargs):
259 args = getattr(fn, 'args', []) 261 args = getattr(fn, 'args', [])
260 if args: 262 if args:
261 cmd = ' '.join(map(util.shellquote, args)) 263 cmd = ' '.join(map(util.shellquote, args))