Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is hg syntax for: is commit A "reachable" from commit B

Tags:

mercurial

The history of my repository is very complex. I often find myself wanting to know if a certain commit from the past "is in" or "is reachable from" a certain revision (usually one of my heads)

How do I do this?

like image 481
Lucas Meijer Avatar asked Feb 19 '12 12:02

Lucas Meijer


People also ask

What does hg commit do?

hg commit creates a snapshot of the changes to 1 or more files in the local repository. Always write a log message when committing changes. hg diff displays differences between revisions. hg revert recovers old versions of files.

What is hg command?

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

How do you use hg Histedit?

edit. Drops to the command prompt, allowing to edit files freely to commit some changes as a separate commit. When done, any remaining uncommitted changes will be committed as well. When done, run hg histedit --continue to finish this step or hg histedit --abort to abandon the new changes and keep the previous state.


1 Answers

You can use the revsets syntax. Suppose you want to ask if revision 4 is "reachable" from revision 9.

Simply do this:

hg log -r "descendants(4) and 9"

if it is reachable, you will see the log message for revision 9. If it is not, there will be no output.

like image 143
Mark Heath Avatar answered Oct 25 '22 19:10

Mark Heath