Track patch across branches?

Matt Harbison matt_harbison at yahoo.com
Wed Dec 5 02:06:13 UTC 2012


gideon <voldermort <at> hotmail.com> writes:

> Let's say I created the patch on branch a, grafted it to branch b, then from
> b to each of c and d. Now I'm looking at the patch on c, and what to know
> where else it's been. origin will presumably tell me b, and then I can run
> origin again on b to get a, but how would I find d? The recursive query
> (query c to get b, then query b to get a) is also clumsy.

'origin(c)' will yield 'a' (the implementation of graft doesn't even record that
'b' was the source, since it sees that 'b' itself originated from 'a').  For
consistency, 'origin(c)' will also yield 'a' if transplant and/or rebase is used
instead of graft (though they do record 'b' as the source internally).

I haven't tried this recently, but something like 'origin(x) or
destination(origin(x))' will get you all of the places a patch X exists (note
that origin(x) for something not created because of a graft/transplant/rebase
will return nothing).  Also note that in the example above, if 'b' was stripped,
'a' would not be found by 'origin(c)' if transplant or rebase was used instead of
graft.  So matching() might be useful too as Angel noted, assuming you don't edit
the commit message when grafting.

--Matt






More information about the Mercurial mailing list