when I run hg out I have 3 outgoing changesets. I want to trash them and revert to how things are in the central repository. How?
Asked
Active
Viewed 1.5k times
16
adambox
- 945
- 3
- 9
- 22
3 Answers
17
Use hg strip 'roots(outgoing())'
wbkang
- 846
- 7
- 10
-
1You can also specify a target for the outgoing changesets (if you have no default repo or you want to strip relative to another repo) using `hg strip 'roots(outgoing(target-name))'`. – Jason R. Coombs Feb 26 '13 at 13:16
-
Thanks @JasonR.Coombs that's super useful. I was curious how change the outgoing() based on the changesets other than the default remote repo url. – wbkang Feb 27 '13 at 00:02
3
The other option is to use hg strip command, which is part of the mq (mercurial queues) extension.
The mercurial philosophy is of an immutable history, so commands which manipulate that history are frowned upon, but there are times when stripping or rebasing may solve more problems than they cause.
If you use TortoiseHg then you will need to enable the MQ extension. Prior to v1.0 THG it was enabled by default, but after much discussion it was decided that it was really an 'advanced' feature that should be left off until the use has the experience to know how to enable it.
Mark Booth
- 2,799
- 1
- 31
- 47
3
Either reclone from the central repo, or use clone -r to reclone only the needed changesets.
tonfa
- 357
- 1
- 7