Concatenating multiple changesets into one changeset

(See also [:EditingHistory])

Suppose you have a [:Repository:repository] with a number of [:ChangeSet:changesets] which you want to combine into a single changeset. This can be done using operations [:Clone:clone], [:Push:push], and [:Pull:pull]. But let's make the following assumptions:

What we do is create a [:Branch:branch] whose root revision is R and which consists of oneFootNote(Actually it can be multiple changesets. The principle is the same, but for simplicity let us assume one.) changeset (result of step 3 below). The procedure is as follows:

1: hg update R

2: hg revert -r tip --all

3: hg ci -m "Combined changesets between R and R+k"

4: hg clone -r tip oldrepo newrepo


CategoryTipsAndTricks