4

I created a dummy repository on bitbucket to try to learn how to do this. I've seen this done in Git, but I am unsure if this is possible in Hg.

I have the following hg log:

changeset:   3:742dd9f71f46
tag:         tip
user:        RHsu
date:        Tue Apr 09 09:58:55 2013 -0400
summary:     added some text to 3

changeset:   2:dd431695edcd
user:        RHsu
date:        Tue Apr 09 09:58:30 2013 -0400
summary:     Let's try to amend this commit

changeset:   1:b59ed9c945f9
user:        RHsu
date:        Tue Apr 09 09:58:15 2013 -0400
summary:     added some text to t1

changeset:   0:a8a24f3831ab
user:        RHsu
date:        Tue Apr 09 09:52:32 2013 -0400
summary:     Add text files for testing

These changesets have been pushed to bitbucket. How can I ammend the commit message of changeset2?

EDIT: I have tried using histedit, but that only changes local commits. Then when I push, two heads are created.

EDIT: Different from the other question since this question deals with editing a commit that has been pushed onto bitbucket.

Rhs
  • 3,188
  • 12
  • 46
  • 84

1 Answers1

4

Bitbucket has a strip function that can be use to strip a changeset from the repository. That's what you have to use in order to get rid of the head you don't want. You get to it at https://bitbucket.org/<user>/<repo>/admin/strip. You can also click on the little gear icon when looking at your repo on the web page and then it will show you the admin interface which has a section for stripping changesets.

Omnifarious
  • 54,333
  • 19
  • 131
  • 194
  • 1
    That appears to remove the changeset rather than modify the commit message. – Rhs Apr 09 '13 at 14:39
  • @Rhs: In git what you are doing is creating a new changeset with a new commit message and telling it to forget the old one is there. So it's basically equivalent. You can tell this is what happens because your changeset has a new hash after you push the commit message. – Omnifarious Apr 09 '13 at 14:40
  • 1
    Something to look forward to; future versions of Mercurial will support the Changeset Evolution feature, which will automatically propagate the “forgetting” of the old changeset if you amend it. – Laurens Holst Apr 10 '13 at 15:07