"Not a head revision!" in Mercurial Hg
Version ControlMercurialTortoisehgVersion Control Problem Overview
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.
Version Control Solutions
Solution 1 - Version Control
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:
- Select File > Settings from the
Workbench
- 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
- Select Workbench in the left list
- In the section on the right, look for a drop down list labeled After Pull Operation
- 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.
Solution 2 - Version Control
This is perfectly normal and correct behavior of Mercurial. Your working directory is currently updated to changeset 8 "Merge 2". The pull operation will not change the contents of your working directory. It simply gets missing changesets and adds them to your history graph. After pulling you are still working on changeset 8. Now the "Not a head revision" appears to warn you, that if you now make any changes and commit them, you will create a new changeset derived from Revision 8, which will effectively create a new branch. This is something you may or may not want to do. Typically after pulling new changesets, you want to update your working directory to the latest changeset, by right-clicking the latest changeset and choosing Update...
P.S. Your are not using the latest verion of TortoiseHG. Please update to the latest version. It contains many improvements and resolves many bugs.