"Not a head revision!" in Mercurial Hg

Uthay picture Uthay · Jan 18, 2013 · Viewed 25.6k times · Source

I am working in a small organisation, only two developers and we use Mercurial version control tortoisehg-2.2.2-hg-2.0.2-x86. I am new to mercurial.

Consider programmerA, programmerB.

In programerA machine I created a repository and a client with name "EFSL". programmerB is simply a client with name "Uthaya Kumar" pointing at programmerA machine repository.

When I am pulling change set in programmerA machine it creates a new branch, and it also shows "Not a head revision!" error in both working directory and repository.

In programmerB it is fine.

Please see the screenshots below.

Thanks in advance.

Screen Shot 1 Screen Shot 2 Screen Shot 3

Answer

Steve Kaye picture Steve Kaye · Jan 18, 2013

Examine the first screen shot and see that the top line says 8+ in the Rev column. This means that your working copy is based off revision 8. You can follow the line down and also see that it joins at revision 8 which indicates the same thing.

There are two ways to solve this depending upon whether you have made any changes or not.

  • If you have not made any changes then you would right click on revision 13 and select Update.... to update to the latest change.

  • If you have made changes then you need to commit those changes and then right click on revision 13 and select Merge with local... which brings up a wizard to handle the merge.

In your last screenshot it seems like you've not got a working copy at all so you need to use the update procedure above to update to revision 13.

You can have the update happen automatically by changing a setting in TortoiseHg:

  1. Select File > Settings from the Workbench
  2. Choose where you want to make the setting change by selecting the appropriate tab at the top. The choices are global to the user or just for this repository
  3. Select Workbench in the left list
  4. In the section on the right, look for a drop down list labeled After Pull Operation
  5. Select update from the list

This will do an update to latest every time you do a pull which will avoid the problem in your first screenshot. You will still have to do a manual merge when you and another developer have made changes.

The other options in that list are rebase and fetch which both rely on the appropriate extension being enabled and are for advanced use only.