Search code examples
mercurialtortoisehgbitbucketvisualhg

Mercurial update did not ask to merge and overwrote working directory


Environment

We have no branches or separate heads at this time.
We each have our working directory on our individual PCs (obviously).


Problem

Developer A pushed a commit out to BitBucket.
Developer B tried to do a commit & push that failed due to changes having been made.
Developer B does a pull on the latest changeset.
Developer B performs an Update ...

At this point, there is usually a merge pop-up that occurs when there are differences in any of the files. There was no such pop-up and therefore overwrote Developer B's working directory.


Question

Is there a way to get back the files that were overwritten before Developer B performed the Update?


Solution

  • In pulling from the repo, you may have set the head to that particular changeset hiding the other branch the Developer was working on. To view the list of heads use hg heads, and then you can manually merge them, hg merge -r <NUM1> -r <NUM2>.