Mercurial > evolve
annotate tests/test-topic-shell-prompt.t @ 5601:3946ee4ee3ae
topic: add a `exp….topic.linear-merge` option to allow some oedipus
If this option is set to `from-branch`, a user can call `hg merge some-topic`
from a bare branch even if `some-topic` is a direct descendant of the current
working copy parents. This was previously denied if the changesets was on the
same branch, since the result would be an "oedipus merge".
Some user have been requesting this, and this type of merge is one of Gitlab
standard way of merging a "Merge Request". That new option will unlock issue
`heptapod#200` and make this mode available for those who wants it.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 14 Oct 2020 15:48:37 +0200 |
parents | ce5ebd9c859b |
children |
rev | line source |
---|---|
5373
ce5ebd9c859b
tests: add a test determining the branch and topic like the Zsh prompt does it
Manuel Jacob <me@manueljacob.de>
parents:
diff
changeset
|
1 $ . $TESTDIR/testlib/topic_setup.sh |
ce5ebd9c859b
tests: add a test determining the branch and topic like the Zsh prompt does it
Manuel Jacob <me@manueljacob.de>
parents:
diff
changeset
|
2 |
ce5ebd9c859b
tests: add a test determining the branch and topic like the Zsh prompt does it
Manuel Jacob <me@manueljacob.de>
parents:
diff
changeset
|
3 Code logically equivalent to the following is used in Zsh to show the branch |
ce5ebd9c859b
tests: add a test determining the branch and topic like the Zsh prompt does it
Manuel Jacob <me@manueljacob.de>
parents:
diff
changeset
|
4 and topic (if set) in the prompt. If the format of the files is changed in a |
ce5ebd9c859b
tests: add a test determining the branch and topic like the Zsh prompt does it
Manuel Jacob <me@manueljacob.de>
parents:
diff
changeset
|
5 way that it breaks the test, a mail should be sent to zsh-workers@zsh.org. |
ce5ebd9c859b
tests: add a test determining the branch and topic like the Zsh prompt does it
Manuel Jacob <me@manueljacob.de>
parents:
diff
changeset
|
6 |
ce5ebd9c859b
tests: add a test determining the branch and topic like the Zsh prompt does it
Manuel Jacob <me@manueljacob.de>
parents:
diff
changeset
|
7 $ get_branch_like_zsh() { |
ce5ebd9c859b
tests: add a test determining the branch and topic like the Zsh prompt does it
Manuel Jacob <me@manueljacob.de>
parents:
diff
changeset
|
8 > branchfile=".hg/branch" |
ce5ebd9c859b
tests: add a test determining the branch and topic like the Zsh prompt does it
Manuel Jacob <me@manueljacob.de>
parents:
diff
changeset
|
9 > topicfile=".hg/topic" |
ce5ebd9c859b
tests: add a test determining the branch and topic like the Zsh prompt does it
Manuel Jacob <me@manueljacob.de>
parents:
diff
changeset
|
10 > if [ -r "${branchfile}" ] ; then |
ce5ebd9c859b
tests: add a test determining the branch and topic like the Zsh prompt does it
Manuel Jacob <me@manueljacob.de>
parents:
diff
changeset
|
11 > r_branch=$(cat "${branchfile}") |
ce5ebd9c859b
tests: add a test determining the branch and topic like the Zsh prompt does it
Manuel Jacob <me@manueljacob.de>
parents:
diff
changeset
|
12 > fi |
ce5ebd9c859b
tests: add a test determining the branch and topic like the Zsh prompt does it
Manuel Jacob <me@manueljacob.de>
parents:
diff
changeset
|
13 > if [ -f "${topicfile}" ] && [ -r "${topicfile}" ] && [ -s "${topicfile}" ] ; then |
ce5ebd9c859b
tests: add a test determining the branch and topic like the Zsh prompt does it
Manuel Jacob <me@manueljacob.de>
parents:
diff
changeset
|
14 > IFS= read -r REPLY < ${topicfile} |
ce5ebd9c859b
tests: add a test determining the branch and topic like the Zsh prompt does it
Manuel Jacob <me@manueljacob.de>
parents:
diff
changeset
|
15 > r_branch=${r_branch}:${REPLY} |
ce5ebd9c859b
tests: add a test determining the branch and topic like the Zsh prompt does it
Manuel Jacob <me@manueljacob.de>
parents:
diff
changeset
|
16 > fi |
ce5ebd9c859b
tests: add a test determining the branch and topic like the Zsh prompt does it
Manuel Jacob <me@manueljacob.de>
parents:
diff
changeset
|
17 > echo $r_branch |
ce5ebd9c859b
tests: add a test determining the branch and topic like the Zsh prompt does it
Manuel Jacob <me@manueljacob.de>
parents:
diff
changeset
|
18 > } |
ce5ebd9c859b
tests: add a test determining the branch and topic like the Zsh prompt does it
Manuel Jacob <me@manueljacob.de>
parents:
diff
changeset
|
19 |
ce5ebd9c859b
tests: add a test determining the branch and topic like the Zsh prompt does it
Manuel Jacob <me@manueljacob.de>
parents:
diff
changeset
|
20 $ hg init |
ce5ebd9c859b
tests: add a test determining the branch and topic like the Zsh prompt does it
Manuel Jacob <me@manueljacob.de>
parents:
diff
changeset
|
21 $ hg branch branch -q |
ce5ebd9c859b
tests: add a test determining the branch and topic like the Zsh prompt does it
Manuel Jacob <me@manueljacob.de>
parents:
diff
changeset
|
22 $ get_branch_like_zsh |
ce5ebd9c859b
tests: add a test determining the branch and topic like the Zsh prompt does it
Manuel Jacob <me@manueljacob.de>
parents:
diff
changeset
|
23 branch |
ce5ebd9c859b
tests: add a test determining the branch and topic like the Zsh prompt does it
Manuel Jacob <me@manueljacob.de>
parents:
diff
changeset
|
24 $ hg topic topic -q |
ce5ebd9c859b
tests: add a test determining the branch and topic like the Zsh prompt does it
Manuel Jacob <me@manueljacob.de>
parents:
diff
changeset
|
25 $ get_branch_like_zsh |
ce5ebd9c859b
tests: add a test determining the branch and topic like the Zsh prompt does it
Manuel Jacob <me@manueljacob.de>
parents:
diff
changeset
|
26 branch:topic |
ce5ebd9c859b
tests: add a test determining the branch and topic like the Zsh prompt does it
Manuel Jacob <me@manueljacob.de>
parents:
diff
changeset
|
27 $ hg topic --clear -q |
ce5ebd9c859b
tests: add a test determining the branch and topic like the Zsh prompt does it
Manuel Jacob <me@manueljacob.de>
parents:
diff
changeset
|
28 $ get_branch_like_zsh |
ce5ebd9c859b
tests: add a test determining the branch and topic like the Zsh prompt does it
Manuel Jacob <me@manueljacob.de>
parents:
diff
changeset
|
29 branch |