Created
July 19, 2015 12:00
-
-
Save 0x5742/adbd503331f321e85a87 to your computer and use it in GitHub Desktop.
mercurial: connecting two related repositories
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This is how to fix things if you somehow manage to end up with two | |
| # repositories for the same project, where the last changeset in the | |
| # old repo should be the parent of the first changeset in the new one. | |
| # I needed to do this for Schism Tracker at one point. No idea how I | |
| # mangled it, but here's what I did. | |
| # (A tip of the hat owed to #mercurial on Freenode for helping me.) | |
| # FOREWARNING: this will alter all the changeset IDs in the new repo! | |
| newid=$(hg -R newrepo log -r0 --template '{node}') | |
| oldid=$(hg -R oldrepo log -rtip --template '{node}') | |
| echo $newid $oldid > map | |
| hg convert --splicemap map newrepo oldrepo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment