2487
Comment:
|
2463
link to PruningDeadBranches is just confusing here
|
Deletions are marked like this. | Additions are marked like this. |
Line 85: | Line 85: |
This assumes you want to get rid of your individual changesets (which are a dangling branch in oldrepo) and just keep the combined changeset (see also [:PruningDeadBranches]). newrepo will now just have the combined changeset. | [[BR]]This assumes you want to get rid of your individual changesets (which are a dangling branch in oldrepo) and just keep the combined changeset. newrepo will now just have the combined changeset. |
Concatenating multiple changesets into one
(See also [:EditingHistory])
Problem
Suppose you want to concatenate the last k changesets of a [:Repository:repository]
into a single, combined changeset
Solution
Execute the following steps:
1: hg update R
This [:Update:updates] the [:WorkingDirectory:working directory] to revision R. Specifically, this means that the contents of the working directory are changed to that of revision R, and that R becomes the [:Parent:parent] of the working directory.
2: hg revert -r tip --all
This [:Revert:reverts] the working directory to its contents at [:Tip:tip]. Since the parent of the working directory is still R, this means that the combined contents of all changesets between R and R+k show up as the modifications in the working directory.
3: hg ci -m "Combine changesets R+1..R+k"
[:Commit:Committing] these modifications creates a new changeset "R+k (combined)", containing combined changesets R+1 to R+k.
4: hg clone -r tip oldrepo newrepo
BRThis assumes you want to get rid of your individual changesets (which are a dangling branch in oldrepo) and just keep the combined changeset. newrepo will now just have the combined changeset.