How can I see, if the changeset has already been grafted between branchX and default? I know, hg graft checks this for me, there I can't graft twice, but I want to list all changesets, which were not grafted between branchX and default. Thanks in advance for your answers.
hg graft allows "cherry-picking," as you noted in your question. For example, you can run hg graft -D "2085::2093 and not 2091" to copy only some changes from another revision. By comparison, hg rebase (with or without --keep ) will grab whatever changeset you specify and all of its decendant changes.
Use the command hg update to switch to an existing branch. Use hg commit --close-branch to mark this branch head as closed. When all heads of a branch are closed, the branch will be considered closed.
Update sets the working directory's parent revision to the specified changeset (see hg help parents). If the changeset is not a descendant or ancestor of the working directory's parent and there are uncommitted changes, the update is aborted.
This information is stored in the so-called "extra" dictionary inside the grafted changeset. This is a simple key-value mapping that you can see with hg log --debug
.
The information is unfortunately not exposed as a revset predicate yet, so you'll have to do it the old-fashioned way: start with
$ hg --debug log -b branchX
to get the changesets on branchX
. Then grep
or otherwise search for lines matching
extra: source=[0-9a-f]{40}
You could use the Mercurial bindings if you want a more high-level access. There are libraries for Java, Python, and Scala at the moment.
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