comparison mercurial/revsetlang.py @ 35561:4c3a4bb31c0e

revsetlang: raise ParseError to report invalid format character It's more common in revset and templater than raising Abort. I have a couple more patches to address exceptions caused by bad format string passed to revset() template function.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 01 Apr 2017 17:12:48 +0900
parents 3a8810c1b9bc
children 8f1a7adb3225
comparison
equal deleted inserted replaced
35560:3a8810c1b9bc 35561:4c3a4bb31c0e
639 # a list of some type 639 # a list of some type
640 pos += 1 640 pos += 1
641 d = expr[pos] 641 d = expr[pos]
642 ret.append(listexp(list(next(argiter)), d)) 642 ret.append(listexp(list(next(argiter)), d))
643 else: 643 else:
644 raise error.Abort(_('unexpected revspec format character %s') % d) 644 raise error.ParseError(_('unexpected revspec format character %s')
645 % d)
645 pos += 1 646 pos += 1
646 647
647 return ''.join(ret) 648 return ''.join(ret)
648 649
649 def prettyformat(tree): 650 def prettyformat(tree):