What's the best way to back out multiple changesets in mercurial?

前端 未结 5 758
Happy的楠姐
Happy的楠姐 2021-02-13 01:33

Is the most reliable method to go one-by-one, using the backout command for each of many changesets, or is there a way to create one big reversal changeset to cover a whole bunc

5条回答
  •  梦毁少年i
    2021-02-13 02:15

    If you don't want the "backout" changesets in your history, you could also do something else:
    Make a clone of your repository, but only up to the last changeset that you don't want to get rid of.

    See Mercurial: Fix a borked history for an example how to do this.

    If your repository was a local one, that's all you have to do.
    But if the bad changesets were already pushed to a central repository, you'd need server access to delete the repository there and replace it by your clone.
    Plus, if someone else already pulled from the repo with the bad changesets, they need to delete and re-clone (otherwise the bad changesets are in the central repo again as soon as one of the other people pushes again).
    So it depends on the circumstances whether this solution is a good one for you...

提交回复
热议问题