Show anonymous heads as feature branches in Feature Branches tab (BB-6939)

Issue #5693 invalid
Dustin Hatch
created an issue

Since the introduction of the "Feature Branches" view, the commit history page no longer shows the list of heads in the default branch, at least for Mercurial. This was a great feature when used with Mercurial's lightweight branching, as it allowed one to quickly see the various branches that haven't been merged in, even those without a name.

Comments (13)

  1. Dustin Hatch reporter

    First, why is this on hold? It's clearly a UI regression; a feature that once existed and was useful is now missing. Second, to partially answer Erik's question, anonymous heads don't show up anywhere anymore. I don't know where it would fit best; either place seems fine to me.

  2. Erik van Zijst staff

    Hi Dustin,

    I'm confused by what you say.

    The commit history page has not been changed recently AFAIK, but I don't understand what you are saying.

    The way the branch labels work on that page is that each commit gets labeled with the branch it is on, unless it is the repo's main branch (typically "default", but this can be configured on the repo's admin page).

  3. Dustin Hatch reporter

    The problem isn't with branch labels, they're still fine.

    When a repository has anonymous heads, for example:

    hg init foo
    cd foo
    touch file-1
    hg ci -A -m "commit 1"
    touch file-2
    hg ci -A -m "commit 2"
    hg up 0
    touch file-a
    hg ci -A -m "commit 3"

    In this scenario, commit 2 becomes an anonymous head. It's still on the default branch, but it isn't tip and has no children. From the command line, you can type hg heads, and you will see both commit 2 and commit 3. If a bunch of commits get made on top of commit 3, finding commit 2 using the commit browser could be difficult, when it eventually needs to be merged in.

    I've created a repository that shows this scenario on BitBucket:

    Previously, when a repository contained anonymous heads, a message would display above the commit log informing the user, and providing links to the different heads.That message and list of links no longer appears.

    I hope that clarifies things a bit.

  4. Erik van Zijst staff

    I'm fairly certain we never had a multiple-heads warning on the commits page. If your head would scroll off the page, it'd be very hard to even notice that it was there.

    However, we did have a warning message like that on the source browser. That message is no longer there (maybe we should add it back in in some form), however, the branch dropdown on the source page does list all the anonymous heads per branch.

  5. Dustin Hatch reporter

    Okay, that may have been what I was thinking of. I guess I felt like it would fit better on the commit browser and just assumed it used to be there when I no longer noticed it.

    I do see the heads listed on the source view page, under the branch selector, which I didn't notice before. Still, I feel like there could be some improvement. Maybe showing anonymous heads on the feature branches page is the best option after all.

    Anyway, thanks for looking into it.

  6. Erik van Zijst staff

    Maybe showing anonymous heads on the feature branches page is the best option after all.

    Treating anonymous heads as feature branches would be tricky for a number of reasons.

    How would Bitbucket know which head is the "real main one" against which the others must be compared? Mercurial's "tip" just takes the highest rev number, but that would cause the "main branch" to continuously switch between the heads depending of the order in which new commits are pushed.

    Which heads would show up as "feature branches" would therefore pretty much be random and rarely correct.

    Another issue would be if you also use named branches. Should normal branches ("normal" in the sense as not being the branch configured as the "main branch" in the repo admin) also get their anonymous heads get interpreted as extra branches? And should they be compared against whichever anon head on the default branch is "tip", or against all of default's heads?

    Mercurial itself does not treat anonymous heads as different branches. They all have the same name and other than their rev numbers there's no way to distinguish between them. I'm reluctant to for Bitbucket to treat them differently if that makes sense.

  7. Log in to comment