Is there an extension with a revset for 'all ancestors along the p1 line'?
Scott Palmer
swpalmer at gmail.com
Sun Jun 5 15:26:11 UTC 2016
On Jun 5, 2016, at 6:08 AM, Sietse Brouwer <sbbrouwer at gmail.com> wrote:
>
> On 04/06/2016, Scott Palmer <swpalmer at gmail.com> wrote:
>> Wouldn’t something like this work:
>>
>> hg log -r “ancestors(my_bookmark) and not ancestors(@) and not merge()"
>>
>
> That works some of the time: it works when my_bookmark is not included
> in the ancestors of @/master/default, but it fails when the branch was
> already merged in.
>
> In general the challenge boils down to this: "use revsets to find
> Changeset X in the diagram below with 'master' and 'my_feature' as the
> only user-supplied arguments". As soon as other branches get merged
> into master, there are a whole bunch of commits that are ancestors of
> master and not descendants of my_feature, and X gets increasingly hard
> to find.
>
> With _firstancestors, you can identify a branch's own commits in
> isolation of the commits that were merged into it, and everything
> becomes a lot easier. X, for example, is the last main commit of
> master that is not a descendant of my_feature:
> 'last(_firstancestors(master) and not descendants(my_feature))'.
>
> o 3 [master] merge into master
> |\
> o | 2 <-- X
> | |I can differentiate
> | o 1 [my_feature]
>
> (Mercurial's named branches would make things even easier. The trouble
> is that my colleagues were already using Git, so I spent most of my
> time with Git remotes and bookmark-based branches.)
So you want to find changesets in master even those that may have been merged into my_feature. So you want the changes that are in master minus the changesets that are exclusively in my_feature?
hg log -r “reverse(ancestors(master) and not (ancestors(my_bookmark) and not ancestors(master)) and) not merge()”
Is that closer?
Scott
More information about the Mercurial
mailing list