Is there an extension with a revset for 'all ancestors along the p1 line'?
Gregory Szorc
gregory.szorc at gmail.com
Sat Jun 4 18:11:41 UTC 2016
On Fri, Jun 3, 2016 at 5:09 AM, Sietse Brouwer <sbbrouwer at gmail.com> wrote:
> Dear list,
>
> I work with bookmark branches, and I often think of a bookmark
> branch's 'mainline' as "all ancestors of this commit, but not
> ancestors that were brought in by merging". In other words,
> p1(master), p1(p1(master)), and so on back to the root.
>
Such a revset does not exist. Even if you built one, it wouldn't do what
you think. The reason is that Mercurial sorts the parent nodes during a
merge commit and stores the node with the smaller bit-wise value in p1. I
do feel it is a bit odd and that it is one of the stranger things that
Mercurial does, at least today. Although historically Mercurial encouraged
the use of named branches. When you were using named branches, you could
query for everything on a specific branch. Named branches have fallen out
of favor in years since (things like bookmarks are preferred).
Unfortunately, that means lots of commits on the "default" branch and an
inability to trace mainline or feature lines of work when merge commits are
involved :/ https://www.mercurial-scm.org/wiki/TopicPlan should help
restore some of this forensic ability.
>
> I know there isn't a p1line revset, but, if I had one, I could do
> things like this to get nearly all commits that were commited directly
> on the feature branch:
>
> -r 'p1line(feature) and not p1line(master)'
>
> (The only thing I'd miss would be diverge-and-merges inside the feature
> branch.)
>
> Before I set about building this revset myself, does anyone know of an
> extension that provides it?
>
> As a final illustration, here is an example history. I have marked
> nodes M if they are part of master's p1 line, F if they are part of
> the feature's p1 line, and MF if they are part of both. The text to
> the right is built up like so:
>
> {rev}, p1:{p1rev}, [{bookmarks}] {my manual remarks}
>
> M 10, p1:9 [master]
> |
> M 9, p1:8, merge feature into master
> |\
> | M 8, p1:5
> | |
> F | 7, p1:6 [feature]
> | |
> F | 6, p1:2, merge master into feature
> |\|
> | M 5, p1:0
> | |
> F | 2, p1:1
> | |
> F | 1, p1:0
> |/
> MF 0, p1:-1
>
> Kind regards,
>
> Sietse Brouwer
> _______________________________________________
> Mercurial mailing list
> Mercurial at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20160604/231f7836/attachment-0002.html>
More information about the Mercurial
mailing list