I was preparing a commit to 3.2 and default branches and mistakenly
used -m insread of -l commit option. As a result, I have
$ hg out
comparing with ssh://hg@hg.python.org/cpython
searching for changes
changeset: 69272:0bf1354fab6b
branch: 3.2
parent: 69268:bfc586c558ed
user: Alexander Belopolsky
On 2011-04-12 20:35, Alexander Belopolsky wrote:
I was preparing a commit to 3.2 and default branches and mistakenly used -m insread of -l commit option. As a result, I have
$ hg out comparing with ssh://hg@hg.python.org/cpython searching for changes changeset: 69272:0bf1354fab6b branch: 3.2 parent: 69268:bfc586c558ed user: Alexander Belopolsky
date: Tue Apr 12 14:00:43 2011 -0400 summary: m.txt changeset: 69273:516ed700ce22 tag: tip parent: 69270:c26d015cbde8 parent: 69272:0bf1354fab6b user: Alexander Belopolsky
date: Tue Apr 12 14:02:22 2011 -0400 summary: m.txt I would like to replace m.txt in the summary with the content of the file m.txt. I tried to use the recipe [1], but qimport fails:
$ hg qimport -r 69272:tip abort: cannot import merge revision 69273
[1] http://stackoverflow.com/questions/623052/how-to-edit-incorrect-commit-messa...
PS: This scenario seems to be a usability regression compared to SVN. SVN would actually warn me if I tried to use -m with a file name instead of a message and editing the commit log in SVN is fairly straightforward.
If you didn't push the changes to any other clone, you can hg strip these changesets and do it again, correctly. strip is part of the rebase extension. You cannot edit history that has already been shared with other clones. If you did, it would just come back at the next pull. -- Sjoerd Mullender
I would like to replace m.txt in the summary with the content of the file m.txt. I tried to use the recipe [1], but qimport fails:
I'd use "hg export": hg export -r 69272:tip > ../patch Edit patch to update commit message cd .. rm this_clone hg clone clean_cpython this_clone cd this_clone hg import ../patch HTH, Martin
Le mardi 12 avril 2011 à 14:35 -0400, Alexander Belopolsky a écrit :
I was preparing a commit to 3.2 and default branches and mistakenly used -m insread of -l commit option. As a result, I have
$ hg out comparing with ssh://hg@hg.python.org/cpython searching for changes changeset: 69272:0bf1354fab6b branch: 3.2 parent: 69268:bfc586c558ed user: Alexander Belopolsky
date: Tue Apr 12 14:00:43 2011 -0400 summary: m.txt changeset: 69273:516ed700ce22 tag: tip parent: 69270:c26d015cbde8 parent: 69272:0bf1354fab6b user: Alexander Belopolsky
date: Tue Apr 12 14:02:22 2011 -0400 summary: m.txt I would like to replace m.txt in the summary with the content of the file m.txt.
I don't know if it is the "right" solution, but I would use hg strip
+histedit. Something like:
$ hg strip 516ed700ce22 # remove commit in the default branch
$ hg update 3.2
$ hg histedit 0bf1354fab6b
On Wed, Apr 13, 2011 at 4:35 AM, Alexander Belopolsky
I was preparing a commit to 3.2 and default branches and mistakenly used -m insread of -l commit option. As a result, I have
If you had caught the change before merging to default, then "hg rollback" would have done the trick, but since there are *two* commits you want to alter, then it seems like one of the hg strip approaches others have suggested will be necessary. Agreed on the usability annoyances arising from mixing the desire for a relative clean history in the main repository and hg's near total intolerance for mistakes, though :P Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia
participants (5)
-
"Martin v. Löwis"
-
Alexander Belopolsky
-
Nick Coghlan
-
Sjoerd Mullender
-
Victor Stinner