Merge two mercurial repositories without breaking file history -
i need merge 2 mercurial repositories brand new, third repository.
project a:
1--2--3
project a':
4--5--6
what want :
project b:
1--2--3--4--5--6
history deleted project because of size limitation on server. don't have size limitation anymore. want bring
similar this question except need solution mercurial
you can , preserve history, changeset hashes change originals.
also, before go on, backups, backups, backups. make sure you're preserving originals in case goes horribly wrong, could.
off top of head have 2 options.
both start pulling project a' project using --force
option allow pull in unrelated repository. e.g.
hg pull --force projecta'
lets call new combined repo project a+.
rebase
then use rebase extension (which needs enabled in mercurial extension settings) rebase changeset 4 , it's descendents onto changeset 3. example:
hg rebase --source 4 --dest 3
you might want use --keepbranches
option, or might reset branch names of revision 3.
i've never used particular tactic myself don't see why wouldn't work.
convert
the second option, have used before, hg convert
splicemap.
splicemap option lets specify new parents changesets, you'd able specify rev 3 rev 4's parent whereas right rev 4 presumably has no parent.
the splicemap text file, , contents formatted like:
revision-hash new-parent-hash
and each map in file separated new line.
have use full hash, friendly revision number or short hash won't work.
then use splicemap following:
hg convert --splicemap splicemap_filepath.txt projecta+ projectb
and spit out project b repo unified history.
depending on size of repos neither of these quick.
Comments
Post a Comment