Mercurial > public > mercurial-scm > hg
comparison mercurial/cmdutil.py @ 36507:165cf86365ff
cmdutil: strip "%m" pattern (first line of commit message) from both ends
This matches the behavior of the template keyword {desc}.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 18 Feb 2018 10:54:24 +0900 |
parents | fd2191d870ff |
children | d7a23d6184a2 |
comparison
equal
deleted
inserted
replaced
36506:74c033b9d579 | 36507:165cf86365ff |
---|---|
896 expander = { | 896 expander = { |
897 'H': lambda: ctx.hex(), | 897 'H': lambda: ctx.hex(), |
898 'R': lambda: '%d' % ctx.rev(), | 898 'R': lambda: '%d' % ctx.rev(), |
899 'h': lambda: short(ctx.node()), | 899 'h': lambda: short(ctx.node()), |
900 'm': lambda: re.sub('[^\w]', '_', | 900 'm': lambda: re.sub('[^\w]', '_', |
901 ctx.description().rstrip().splitlines()[0]), | 901 ctx.description().strip().splitlines()[0]), |
902 'r': lambda: ('%d' % ctx.rev()).zfill(revwidth or 0), | 902 'r': lambda: ('%d' % ctx.rev()).zfill(revwidth or 0), |
903 '%': lambda: '%', | 903 '%': lambda: '%', |
904 'b': lambda: os.path.basename(ctx.repo().root), | 904 'b': lambda: os.path.basename(ctx.repo().root), |
905 } | 905 } |
906 if total is not None: | 906 if total is not None: |