# HG changeset patch # User Sietse Brouwer # Date 1602704315 -7200 # Wed Oct 14 21:38:35 2020 +0200 # Node ID f1a08479877c2cb5c8bc5f858c595c96f40a24b3 # Parent 0d3229120aff331970cba4591c1304f7fc59b394 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 diff --git a/prompt.py b/prompt.py --- a/prompt.py +++ b/prompt.py @@ -346,7 +346,7 @@ 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'\<([^><]*?\<)?' diff --git a/tests/test_update.py b/tests/test_update.py --- a/tests/test_update.py +++ b/tests/test_update.py @@ -71,11 +71,9 @@ 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}')