2

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

user2713461
  • 387
  • 2
  • 5
  • 16

2 Answers2

1

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
EvgeniySharapov
  • 3,078
  • 3
  • 27
  • 38
0

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

andref
  • 750
  • 5
  • 20