Mercurial > evolve
comparison tests/test-topic.t @ 4061:ad4194399b47
topic: handle ambiguous arguments to topic() revset
These arguments can be interpreted as either string or a revset. The decision
is made based on existence of topic with such a name. This matches the behavior
of branch() revset.
The code needs to know all topics that ever existed in the repo, because some
commands report "disappearance" of topics after certain operations, using this
revset (e.g. via stack.stack or repo.revs).
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Thu, 30 Aug 2018 21:05:17 +0800 |
parents | 54eade86ac31 |
children | 6774820c8a2e |
comparison
equal
deleted
inserted
replaced
4060:54eade86ac31 | 4061:ad4194399b47 |
---|---|
739 Using revsets in topic() | 739 Using revsets in topic() |
740 $ tlog() { | 740 $ tlog() { |
741 > hg log -T '{rev}: {topic}\n' -r "$1" | 741 > hg log -T '{rev}: {topic}\n' -r "$1" |
742 > } | 742 > } |
743 | 743 |
744 $ tlog 'topic(9)' | |
745 9: fran | |
746 $ tlog 'topic(8)' | |
744 $ tlog 'topic(head())' | 747 $ tlog 'topic(head())' |
745 9: fran | 748 9: fran |
746 $ tlog 'topic(:)' | 749 $ tlog 'topic(:)' |
747 9: fran | 750 9: fran |
748 $ tlog 'topic(all())' | 751 $ tlog 'topic(all())' |
749 9: fran | 752 9: fran |
750 $ tlog 'topic(topic(fran))' | 753 $ tlog 'topic(topic(fran))' |
751 9: fran | 754 9: fran |
752 $ tlog 'topic(wdir())' | 755 $ tlog 'topic(wdir())' |
753 9: fran | 756 9: fran |
757 $ tlog 'topic(nonsense)' | |
758 abort: unknown revision 'nonsense'! | |
759 [255] | |
760 | |
761 Pattern matching in topic() revset | |
762 $ tlog 'topic("re:nonsense")' | |
763 $ tlog 'topic("literal:nonsense")' | |
764 abort: topic 'nonsense' does not exist! | |
765 [255] | |
754 | 766 |
755 Deactivate the topic. | 767 Deactivate the topic. |
756 $ hg topics | 768 $ hg topics |
757 * fran (1 changesets) | 769 * fran (1 changesets) |
758 $ hg topics --clear | 770 $ hg topics --clear |