Compress away all parents in a repository?

前端 未结 1 793
野趣味
野趣味 2021-01-21 07:51

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\")

相关标签:
1条回答
  • 2021-01-21 08:23

    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 :)
    0 讨论(0)
提交回复
热议问题