# HG changeset patch # User Yuya Nishihara # Date 1518918864 -32400 # Node ID 165cf86365ffa39fcfe4c83e1f6cdb690f9e179e # Parent 74c033b9d579c9f9dae0a43f46f40cd1adff0a2c cmdutil: strip "%m" pattern (first line of commit message) from both ends This matches the behavior of the template keyword {desc}. diff -r 74c033b9d579 -r 165cf86365ff mercurial/cmdutil.py --- a/mercurial/cmdutil.py Tue Feb 27 22:37:57 2018 +0900 +++ b/mercurial/cmdutil.py Sun Feb 18 10:54:24 2018 +0900 @@ -898,7 +898,7 @@ 'R': lambda: '%d' % ctx.rev(), 'h': lambda: short(ctx.node()), 'm': lambda: re.sub('[^\w]', '_', - ctx.description().rstrip().splitlines()[0]), + ctx.description().strip().splitlines()[0]), 'r': lambda: ('%d' % ctx.rev()).zfill(revwidth or 0), '%': lambda: '%', 'b': lambda: os.path.basename(ctx.repo().root), diff -r 74c033b9d579 -r 165cf86365ff tests/test-export.t --- a/tests/test-export.t Tue Feb 27 22:37:57 2018 +0900 +++ b/tests/test-export.t Sun Feb 18 10:54:24 2018 +0900 @@ -184,7 +184,7 @@ $ hg commit -m " !\"#$%&(,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]"'^'"_\`abcdefghijklmnopqrstuvwxyz{|}~" $ hg export -v -o %m.patch tip exporting patch: - ____________0123456789_______ABCDEFGHIJKLMNOPQRSTUVWXYZ______abcdefghijklmnopqrstuvwxyz____.patch + ___________0123456789_______ABCDEFGHIJKLMNOPQRSTUVWXYZ______abcdefghijklmnopqrstuvwxyz____.patch Invalid pattern in file name: