Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hg: Find out if a branch has been merged in to default?

So I've got a long and detailed Mercurial Repository which has been worked on by several times over a long period of time with lots of branches, in that time no one knew that you can close a branch.

Recently I've closed nearly 1200 abandoned heads and it runs a lot better. However we have a number of branches which we want to preserve. Some I think may have already been merged back in to default but I'm not sure.

I can see if I run hg branches that they are marked as (inactive) meaning that it has been merged in to another branch but on checking its not merged directly back in to default. Is there a way I can check if somewhere these branches have been merged back in to default even if its via another branch ?

like image 268
Mark Broadhurst Avatar asked Feb 18 '15 16:02

Mark Broadhurst


1 Answers

I believe you can accomplish that with revsets, in particular:

hg log -r "not ancestors(heads(default)) and head() and not closed()"

That should get you all heads of named branches that have not been closed and are not ancestors of (i.e. have not been merged into) the default branch.

like image 148
Edward Avatar answered Oct 19 '22 20:10

Edward