diff --git a/mercurial/fancyopts.py b/mercurial/fancyopts.py --- a/mercurial/fancyopts.py +++ b/mercurial/fancyopts.py @@ -362,7 +362,15 @@ def abort(s): raise error.Abort( _('invalid value %r for option %s, %s') % (val, opt, s)) - state[name] = defmap[name].newstate(state[name], val, abort) + if name == 'message': + if state[name] != '': + new_message = state[name] + "\n\n" + val + state[name] = defmap[name].newstate(state[name], \ + new_message, abort) + else: + state[name] = defmap[name].newstate(state[name], val, abort) + else : + state[name] = defmap[name].newstate(state[name], val, abort) # return unparsed args return args diff --git a/tests/test-commit.t b/tests/test-commit.t --- a/tests/test-commit.t +++ b/tests/test-commit.t @@ -832,3 +832,21 @@ $ cd .. +Test that commit accpets multiple message (-m) flags + + $ hg init test4 + $ cd test4/ + $ echo a>>a + $ hg commit -qAm "This is the first line" -m "This is the follwing line" + $ hg log -v + changeset: 0:5e33a0fb6989 + tag: tip + user: test + date: Thu Jan 01 00:00:00 1970 +0000 + files: a + description: + This is the first line + + This is the follwing line + + $ cd ..