Mercurial: multiline commit message on the command

2019-03-17 02:28发布

How can I specify a multiline commit message for mercurial on the command line?

hg commit -m "* add foo\n* fix bar"

does not work. The log shows:

changeset:   13:f2c6526e5911
tag:         tip
date:        Fri Jan 23 23:22:36 2009 +0100
files:       foobar.cpp
description:
    * add foo\n*fix bar

7条回答
仙女界的扛把子
2楼-- · 2019-03-17 03:06

In bash (since version 2.0):

hg commit -m $'foo\nbar'

(I.e. put a dollar sign before an opening single quote to make it parse escape sequences (like \n) within the string — note that it doesn't work with double quotes.)

查看更多
登录 后发表回答