William Jockusch
William Jockusch

Reputation: 27285

hg update leads to failed merge

Let's say I'm at revision n of my repo. I have uncommitted changes. Forgetting about my changes, I update to revision n-1. Normally, mercurial simply merges in my uncommitted changes, and everything goes off without a hitch. But sometimes there are merge conflicts. Now I would have to resolve the conflicts by hand. I would much prefer to recover the state prior to the update. Or better yet, tell mercurial to always abort an update if it runs into merge conflicts during the update. Is there a simple way to do that?

Upvotes: 2

Views: 327

Answers (1)

Mark
Mark

Reputation: 462

You can use --config ui.merge=internal:fail to NOT attempt a merge that is in both. You would then need to manually merge or use the resolve command.

If using TortoiseHG you can deselect the Always merge option when updating which will cause THG to ask you what it should do. Deselecting the Automatically resolve merge conflicts where possible is the equivalent of internal.fail noted above.

Upvotes: 3

Related Questions