D583: commands: correctly show inactive multiheaded branches

the31k phabricator at mercurial-scm.org
Fri Sep 1 10:09:04 EDT 2017


the31k planned changes to this revision.
the31k added a comment.


  In https://phab.mercurial-scm.org/D583#9714, @yuja wrote:
  
  > The logic looks correct. Can you add some tests?
  
  
  Ok, I will try to.

INLINE COMMENTS

> yuja wrote in branchmap.py:225
> `iterbranches()` could have `closed=False` option to filter out
> closed heads, but in which case, the `tip` would have to follow
> it as well.
> 
> I'm not sure which will be a better API.

I have thought about it, but reasoning in terms of `hg branches` code we actually are not allowed to filter out closed tip. Command needs to get closed tip if it is there.

Also, we need to do heads filtering only if tip is not closed itself. But if it is - we are ok to skip filtering, because branch is already known to be inactive.

We can't do this in `iterbranches` code in elegant way, because we will end up with something like `closed_heads=False` or even `closed_heads_is_tip_is_open`. I tried to go with `closed_heads=False`, but later decided to move this logic to branches function.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D583

To: the31k, #hg-reviewers, yuja
Cc: yuja, mercurial-devel


More information about the Mercurial-devel mailing list