annotate tests/test-topic-shell-prompt.t @ 5777:c5dfbbe4363d

evolve: when relocating, optionally first try to do it using in-memory merge This patch adds a config option to let run evolve's relocation step using in-memory merge. It is disabled by default. When the option is on, the relocation is first attempted in memory. If that fails because of merge conflicts, it retries that commit in the working copy. There are a few reasons that I made it configurable. The most important one is that the precommit hook won't trigger when using in-memory merge. Another reason is that it lets us roll out the feature slowly to our users at Google. For now, we also update the working copy after creating the commit (in the successful case, when there are no merge conflicts). The next patch will make it so we don't do that update. Because of the unnecessary working-copy update, this patch doesn't provide any benefit on its own. Evolving 29 commits that each change one line in the hg slows down from ~4.5s to ~4.8s when the config option is on. I've added `#testcases inmemory ondisk` to select `.t` files. Almost all differences are because of the new "hit merge conflicts" message and retrying the merge. There's also one difference in `test-stabilize-order.t` caused by the different order of working copy updates (we now update the working copy at the end).
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 15 Oct 2020 15:40:36 -0700
parents ce5ebd9c859b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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