". Now I noticed that I have not given prope" /> ". Now I noticed that I have not given prope" /> ". Now I noticed that I have not given prope"/>

How to change a commit message in hg mq?

559 Views Asked by At

I have added 4 patches to my workspace. While creating these patches, I had used qnew -m "<commit-message>". Now I noticed that I have not given proper commit message. How to modify all the commit messages?

I tried few things:
$ hg ci;
abort: cannot commit over an applied mq patch

$ hg qci
abort: no queue repository

2

There are 2 best solutions below

0
andref On

You should not use mq anymore. Instead, use histedit, commit --amend or rebase. See this post.

0
EvgeniySharapov On

You can do it only to the last applied patch on the queue via qrefresh. If you need to change all of the commit messages in the same way, e.g. adding an issue in front of the message, then you can write a script that would do it. Let's assume you have all you patches applied, then we will qref a patch and then qpop it until all of them changed. qheader will give you a message of the top patch. So using bash your script would roughly look as follows:

amendment="ISSUE-123: "
echo "Let's go and change the patches"
while [ $? -ne 0 ]; do
    hg qref -m "${amendment} $(hg qheader)" && hg qpop
done