Question

I removed my last question because I think I'll ask a more simple question: Is there a way to compress ALL parents of a node (Basically, "pretend the repository starts here").

So turn

 o---o----o---o----o ....... x--+--+----+--+----+
     \    \        /                 \         /
      o---o---o----o                  *----*---*

into

 x--+--+----+--+----+
 \         /
  *----*---*

(Even better if I can modify x, but beggars can't be choosers)

Was it helpful?

Solution

Here's how I would approach it by making a new repo that will have the history you'd like using the Convert Extention:

  1. Update the source repo to the the new "initial commit" (x in your diagram)
  2. Copy (file copy, not clone!) to the target directory and hg init a new repo
  3. use hg convert with the --splicemap option to say "start at revision x in the source repo and apply it to revision 0 in the target repo". e.g. (note: untested!)
    hg convert --splicemap splicemap.txt .\old-repo .\new-repo
    and splicemap.txt has
    [hash-of-x-in-old-repo] [hash-of-x-in-new-repo]
  4. I'd then zip up the source repo in case I ever needed it again :)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top