Question

I use two mercurial repositories, one for the current stable version and one for new development. I accidentally developed a new feature inside the current stable repo and now I want to commit the changes to the new dev repo and not to the current stable repo. Is there a way to do this? I have not committed any of my changes yet.

Was it helpful?

Solution

Use

hg diff >changes.patch

To create a patch of your changes. Then, go in the other repo, update where you need your changes to be, and issue

hg import --no-commit changes.patch

With the proper folder to changes.patch You should then be at the same place you were on the other repo, too.

However, if both repos are equivalent, whether you commit and push your changes from the current repo or the other, they could eventually be replicated on both, so think about the necessity of moving the changes across repos. Use branches to handle different feature development.

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