Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Not a head revision!" in Mercurial Hg

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 1Screen Shot 2Screen Shot 3

like image 852
Uthay Avatar asked Jan 18 '13 06:01

Uthay


People also ask

What does hg revert do?

hg revert changes the file content only and leaves the working copy parent revision alone. You typically use hg revert when you decide that you don't want to keep the uncommited changes you've made to a file in your working copy.

What is the hg command?

Description. The hg command provides a command line interface to the Mercurial system.

How do you undo a hg pull?

There is only one level of rollback, and there is no way to undo a rollback. It will also restore the dirstate at the time of the last transaction, losing any dirstate changes since that time. This command does not alter the working directory.


2 Answers

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.

like image 76
Steve Kaye Avatar answered Oct 07 '22 19:10

Steve Kaye


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.

like image 43
Eiver Avatar answered Oct 07 '22 21:10

Eiver