7

After using hg qnew and hg qrefresh to create and update a patch that I want to apply to my repository, but the commit message that I wrote when I did hg qnew was not very good, it did not reference the ticket number from trac, and I would like to say something in it about some of the issues that my commit addresses.

How do I do something like hg qrewritemycommitmessage. I have examined the docs on the website and I have come up blank.

Martin Geisler
  • 72,968
  • 25
  • 171
  • 229
Jerub
  • 41,746
  • 15
  • 73
  • 90

2 Answers2

7

You just do hg qrefresh -m "new commit message".

kuy
  • 944
  • 5
  • 12
5

In addition to

$ hg qrefresh -m "new message"

suggested by kuy, you can also use

$ hg qrefresh -e

to edit the current message. I find that very handy since I often have multi-line commit messages that I need to revise many times over the lifetime of a patch. Infact, I always create my patches with no commit message — just hg qnew foo — and then edit the commit message as I go along.

Martin Geisler
  • 72,968
  • 25
  • 171
  • 229
  • +1 - way more useful, since you don't necessarily know exactly what to write until the code change has been implemented. – Lstor Nov 02 '12 at 14:40