Question

I have a central Mercurial repository containing a history cloned from a SVN repository using hgsubversion. I have pulled the additional commits made to the SVN repository since the original hg repo was cloned; these are currently in the default branch.

I also have a named branch. I have cloned this branch (using hg clone -b mybranch) to my local system. Now I want to grab the changes that exist only in default and make them available in my named branch. The obvious way I see to do it is to do a hg update mybranch on the repo, then hg merge default and commit. This seems perilous--if I forget to update back to default after I'm done, all future pulls from SVN will pull changes into mybranch.

I have also considered that perhaps I should not have specified mybranch when I cloned the repo, but cloned the entire repo and just updated to mybranch locally. Thus I could pull the changes in default to my local clone and do the merge there.

What's the right answer here? Do it on the shared repo and just be careful? Clone everything and manage branches locally? Or is there an easier solution I'm missing?

Was it helpful?

Solution

In general with Mercurial, anytime that I do something that I think might cause issues, I clone the repo and try it out there. Then I can either choose to push those changes back in or perform the action on the real repository. Either way I have the option of failing and not causing any damage. Clones can be thrown away, you don't have to keep them around if you screwed up.

OTHER TIPS

Do it in the shared repo and be careful. Or clone the entire shared repo, do the merge there, and then push to the branch-only clone.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top