With Mercurial, how do you register a branch with cross-branching ancestors?

In Mercurial, I want to create a changelog of all commit messages for my branch changes stable

. I am currently using:

hg log -r <oldid>::<newid>

where the revision id of the changeset is the last time the code was pushed and it is stable

tip. This works great for code changes that are only on a branch stable

, but if I merge another branch (like a new major version with its own development branch), all those commit messages are omitted! Instead, I only get 1 commit from which it is merged into stable

. I would like somehow (preferably w / hg log

) to see them as well.

I do NOT want any "unpublished" commits on this list, i.e. are committed to any branches that have not been merged into stable

.

Here's an example of what I'm looking for: HG Graph example

In this example, the last pressed revision is 540. Because of this, I don't want anything at 540 or below. There are multiple branches on default

and back on stable

and I want it all (539, 541-557 in green). However, there are some changes that have NOT been merged back into stable

(558-563) that I want to omit. Pay special attention to version 539; it was not leaked in stable

when 540 was published and therefore was not included. But now it has since been merged into stable

, so I would like to include it!

Any advice you guys would appreciate. Thank!

+3


source to share


2 answers


Not sure if 100% this will work:

hg log -r '::stable - ::540'

      



I'm not sure about this, because I would think that the command you provided would be mostly correct, except for changeset 539. You won't miss -b stable

before hg log

by mistake, do you?

+5


source


Have a look at revsets . Kevin posted a short form of what you want - here's the long form:

hg log -r "ancestors('stable') and not ancestors(540)"

      



Revsets are incredibly powerful and you can simply type them into the TortoiseHg filter panel.

+3


source







All Articles