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?
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.
Description. The hg command provides a command line interface to the Mercurial system.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With