annotate tests/test-topic-prev-next.t @ 5883:24bfb5c7bf7a stable

next: filter unstable targets by topic only when there's no --no-topic Otherwise --no-topic makes no difference in how hg next works with unstable targets. Now that aspchildren filtering code actually works, this patch makes hg next behave correctly when dealing with unstable changesets with a different topic.
author Anton Shestakov <av6@dwimlabs.net>
date Thu, 22 Apr 2021 17:18:37 +0800
parents
children 21a8f0336f26
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5883
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
1 $ . "$TESTDIR/testlib/topic_setup.sh"
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
2 $ . "$TESTDIR/testlib/common.sh"
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
3
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
4 $ cat << EOF >> $HGRCPATH
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
5 > [extensions]
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
6 > evolve =
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
7 > [ui]
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
8 > logtemplate = '{rev} [{topic}] {desc}\n'
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
9 > EOF
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
10
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
11 Making sure plain hg next sticks to topic when target is unstable
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
12
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
13 $ hg init next-unstable-topic
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
14 $ cd next-unstable-topic
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
15
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
16 $ mkcommit ROOT
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
17 $ hg topics topic-a
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
18 marked working directory as topic: topic-a
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
19 $ mkcommit A
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
20 active topic 'topic-a' grew its first changeset
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
21 (see 'hg help topics' for more information)
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
22 $ hg topics topic-b
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
23 $ mkcommit B
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
24 active topic 'topic-b' grew its first changeset
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
25 (see 'hg help topics' for more information)
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
26 $ hg up 'topic("topic-a")'
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
27 switching to topic topic-a
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
28 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
29 $ echo foo > foo
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
30 $ hg ci -A --amend
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
31 adding foo
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
32 1 new orphan changesets
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
33 $ hg log -G
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
34 @ 3 [topic-a] A
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
35 |
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
36 | * 2 [topic-b] B
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
37 | |
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
38 | x 1 [topic-a] A
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
39 |/
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
40 o 0 [] ROOT
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
41
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
42
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
43 $ hg next
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
44 no children on topic "topic-a"
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
45 do you want --no-topic
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
46 [1]
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
47
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
48 $ hg next --no-topic
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
49 move:[2] B
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
50 atop:[3] A
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
51 working directory is now at 53f8332d648f
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
52
24bfb5c7bf7a next: filter unstable targets by topic only when there's no --no-topic
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
53 $ cd ..