⇤ ← Revision 1 as of 2008-04-30 20:57:35
Size: 998
Comment: stub
|
Size: 1345
Comment: fmt, and more text
|
Deletions are marked like this. | Additions are marked like this. |
Line 3: | Line 3: |
{{{ | |
Line 8: | Line 9: |
}}} | |
Line 9: | Line 11: |
If you only want to merge certain files or directories from REPO2 into REPO1, you can use the ConvertExtension to create a repository with only the files from REPO2 that you want, then treat that as your REPO2 when following the instructions above. | You can keep pulling changes from both repositories in the future, if you like. |
Line 11: | Line 13: |
'''Renaming.''' Now suppose you want the files from REPO2 to live in a subdirectory of REPO1 called "lib2". Here's how to do that without using `hg convert`: | On the other hand, if you're doing this in order to ''stop'' using two separate repositories, just `hg push REPO1` and you're finished. |
Line 13: | Line 15: |
'''Filtering.''' If you only want to merge certain files or directories from REPO2 into REPO1, you can use the ConvertExtension to create a repository with only the files from REPO2 that you want, then treat that as your REPO2 when following the instructions above. '''Renaming.''' Now suppose you want the files from REPO2 to live in a subdirectory of REPO1 called "lib2". Here's how to do that (without using `hg convert`): {{{ |
|
Line 22: | Line 29: |
}}} Again, you can continue to pull changes from both repositories if needed. Or not. |
To merge two unrelated repositories, preserving history, follow these steps.
hg clone REPO1 work # First pull from both repos... cd work hg pull -f REPO2 hg merge # Then simply merge. hg commit
You can keep pulling changes from both repositories in the future, if you like.
On the other hand, if you're doing this in order to stop using two separate repositories, just hg push REPO1 and you're finished.
Filtering. If you only want to merge certain files or directories from REPO2 into REPO1, you can use the ConvertExtension to create a repository with only the files from REPO2 that you want, then treat that as your REPO2 when following the instructions above.
Renaming. Now suppose you want the files from REPO2 to live in a subdirectory of REPO1 called "lib2". Here's how to do that (without using hg convert):
hg clone REPO1 work # Again, pull from both repos... cd work hg pull -f REPO2 hg update -C tip # Now update to the REPO2 tip... mkdir lib2 # And rename everything... hg rename * lib2 hg commit -m "Move everything into lib2 directory." hg merge # Then simply merge. hg commit
Again, you can continue to pull changes from both repositories if needed. Or not.