Mercurial > hg
comparison mercurial/revsetlang.py @ 35559:a480551bd1b4
revsetlang: unnest "if True" in formatrevspec()
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 01 Apr 2017 16:56:47 +0900 |
parents | dfc628611144 |
children | 3a8810c1b9bc |
comparison
equal
deleted
inserted
replaced
35558:dfc628611144 | 35559:a480551bd1b4 |
---|---|
628 if q < 0: | 628 if q < 0: |
629 ret.append(expr[pos:]) | 629 ret.append(expr[pos:]) |
630 break | 630 break |
631 ret.append(expr[pos:q]) | 631 ret.append(expr[pos:q]) |
632 pos = q + 1 | 632 pos = q + 1 |
633 if True: | 633 d = expr[pos] |
634 if d == '%': | |
635 ret.append(d) | |
636 elif d in 'dsnbr': | |
637 ret.append(argtype(d, args[arg])) | |
638 arg += 1 | |
639 elif d == 'l': | |
640 # a list of some type | |
641 pos += 1 | |
634 d = expr[pos] | 642 d = expr[pos] |
635 if d == '%': | 643 ret.append(listexp(list(args[arg]), d)) |
636 ret.append(d) | 644 arg += 1 |
637 elif d in 'dsnbr': | 645 else: |
638 ret.append(argtype(d, args[arg])) | 646 raise error.Abort(_('unexpected revspec format character %s') % d) |
639 arg += 1 | |
640 elif d == 'l': | |
641 # a list of some type | |
642 pos += 1 | |
643 d = expr[pos] | |
644 ret.append(listexp(list(args[arg]), d)) | |
645 arg += 1 | |
646 else: | |
647 raise error.Abort(_('unexpected revspec format character %s') | |
648 % d) | |
649 pos += 1 | 647 pos += 1 |
650 | 648 |
651 return ''.join(ret) | 649 return ''.join(ret) |
652 | 650 |
653 def prettyformat(tree): | 651 def prettyformat(tree): |