bring two repositories back together

Kevin Bullock kbullock+mercurial at ringworld.org
Mon May 16 16:03:42 UTC 2011


On May 16, 2011, at 7:59 AM, John Stean wrote:

> Hello,
> 
> Hope I can explain this clearly - this is what we did:
> 
> 1) Repository A has contained our codebase for some time, but we wanted a lengthy "branch" project
> 2) Rightly or wrongly, we cloned repository A into a new repository, repository B, so they both were identical
> 3) We continued committing to repository A, but also pulled ALL those changed into repository B so B always contained A's changes
> 4) We also added to repository B
> 5) Now we are finished with the project in B, we want to make repository A = repository B
> 
> SO Ideally I just want repository A to become exactly repository B - mainly for naming conventions more than anything as the production site points at repository A.
> 
> Would I just change the path in repository A hgrc file to = path to repository B, then update -C, then change the path name back to repository A? 
> 
> Really hope that you can help - should I be doing this a different way?

There's two things at play here.

1. You have (at least) two clones of your repository. IIUC you want to put one of those clones in the place of the other. This part is easy: each clone is self-contained, so just rename A to some other useful name, and then rename B to A's former name.

2. Your two clones have different changes. As far as I can gather from your description, B has one (topological) branch that is exactly what's in A, and another branch of its own changes, i.e.:

o--o--o--o      <-- pulled from A
    \
     o--o--o    <-- only in B

This brings up some questions:

Have you merged the two branches together in B?
Do you want the changes from A incorporated into B's branch?

pacem in terris / mir / shanti / salaam / heiwa
Kevin R. Bullock




More information about the Mercurial mailing list