WIP: update: Restore non-head behaviour. TODO: - [ ] Understand what that changest d87b actually changed - [ ] create testcase for non-tip branch head (open branch) - [ ] create testcase for non-tip branch head (inactive (closed?) branch) - [ ] maybe this should be a separate '{nonhead}' keyword, rather than keep messing with '{update}'? hg-prompt used to mark the tip commit as '', and non-tip commits as '^'. Since commit 34c0e34e7fe7, we instead mark all head commits as '', and non-head commits as '^'. The test for non-tip head commits was never updated (and must have been failing all this time). This commit - fixes the test - removes a comment that referred to the old behaviour. - backs out changeset d87bc22b5a2e, which reverted to the old behaviour
2 files changed, 2 insertions(+), 4 deletions(-) M prompt.py M tests/test_update.py
M prompt.py +1 -1
@@ 346,7 346,7 @@ def prompt(ui, repo, fs='', **opts): tip = head break - return _with_groups(m.groups(), '^') if repo[tip].node() != current_rev.node() else '' + return _with_groups(m.groups(), '^') if current_rev.children() else '' if opts.get("angle_brackets"): tag_start = r'\<([^><]*?\<)?'
M tests/test_update.py +1 -3
@@ 71,11 71,9 @@ def test_multiple_branches(): output = prompt(fs='{update}') assert output == '^' - # This test case matches the behavior of Mercurial, but it seems a bit - # unintuitive to me. hg_update(2) output = prompt(fs='{update}') - assert output == '^' + assert output == '' hg_update(1) output = prompt(fs='{update}')