2011年1月3日星期一

[Mercurial] Export and Import CS by bundle/unbundle

1. Bundle a changeset
Suppose the project have 2 developer A, B, working on a common base, then make their own change in their local working directories.
After B fix a bug and commit to his local repository (but havn't pushed to main), and A want B's changes, B can create a bundle for A by:

$ hg bundle -r BUG_FIX_CSID --base BASE_CSID b_changes.hg

2. Sending the bundle
These bundle files can then be exchanged via email attachments, FTP, USB drive, etc.

3. Unbundle, Update and Merge
After A received b_changes.hg, A can unbundle the file to A's local repository by:

$ hg unbundle b_changes.hg

This will create a new head.
A need to "hg update" to update A's working directory with B's bug fix which has been pull/import/unbundle to A's local repository.

Then A can see B changed files by "hg status", "hg diff", then merge by "hg merge".
Finally, "hg push" to main repository.

沒有留言:

發佈留言