Mercurial > evolve
annotate tests/test-cmdserver.t @ 6931:237f99ee3d64 stable
tests: remove leading spaces in `hg help` output, run only on Mercurial 6.9+
Core decided to remove a lot of leading spaces in docstrings to support Python
3.13, see 51057ab0dffa for details.
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Mon, 11 Nov 2024 10:39:57 +0400 |
parents | b4f9b7e468ee |
children |
rev | line source |
---|---|
6298
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
1 #require no-rhg no-chg |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
2 |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
3 XXX-RHG this test hangs if `hg` is really `rhg`. This was hidden by the use of |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
4 `alias hg=rhg` by run-tests.py. With such alias removed, this test is revealed |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
5 buggy. This need to be resolved sooner than later. |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
6 |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
7 XXX-CHG this test hangs if `hg` is really `chg`. This was hidden by the use of |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
8 `alias hg=chg` by run-tests.py. With such alias removed, this test is revealed |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
9 buggy. This need to be resolved sooner than later. |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
10 |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
11 $ . "$TESTDIR/testlib/topic_setup.sh" |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
12 |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
13 #if windows |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
14 $ PYTHONPATH="$RUNTESTDIR/../contrib;$PYTHONPATH" |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
15 #else |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
16 $ PYTHONPATH="$RUNTESTDIR/../contrib:$PYTHONPATH" |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
17 #endif |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
18 $ export PYTHONPATH |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
19 |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
20 typical client does not want echo-back messages, so test without it: |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
21 |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
22 $ grep -v '^promptecho ' < $HGRCPATH >> $HGRCPATH.new |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
23 $ mv $HGRCPATH.new $HGRCPATH |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
24 |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
25 $ hg init repo |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
26 $ cd repo |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
27 |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
28 $ touch a |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
29 $ hg ci -Am 'a' |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
30 adding a |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
31 $ touch b |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
32 $ hg ci -Am 'b' |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
33 adding b |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
34 $ touch c |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
35 $ hg ci -Am 'c' |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
36 adding c |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
37 $ touch d |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
38 $ hg ci -Am 'd' |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
39 adding d |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
40 |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
41 Ensure that topics are not left around for stale revisions. |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
42 |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
43 >>> from hgclient import check, readchannel, runcommand |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
44 >>> @check |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
45 ... def checkruncommand(server): |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
46 ... # hello block |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
47 ... readchannel(server) |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
48 ... |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
49 ... # Initial case |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
50 ... runcommand(server, [b'log', b'-T', b'{rev} {desc} ({topic})\n']) |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
51 ... |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
52 ... # first topic |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
53 ... runcommand(server, [b'topic', b'topic1', b'-r', b'.']) |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
54 ... |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
55 ... # Current state |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
56 ... runcommand(server, [b'log', b'-T', b'{rev} {desc} ({topic})\n']) |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
57 ... |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
58 ... # status quo ante |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
59 ... runcommand(server, [b'rollback', b'--config', b'ui.rollback=True']) |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
60 ... |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
61 ... # Current state |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
62 ... runcommand(server, [b'log', b'-T', b'{rev} {desc} ({topic})\n']) |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
63 ... |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
64 ... # second topic |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
65 ... runcommand(server, [b'topic', b'topic2', b'-r', b'(.^^)::']) |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
66 ... |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
67 ... # Current state |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
68 ... runcommand(server, [b'log', b'-T', b'{rev} {desc} ({topic})\n']) |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
69 ... |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
70 ... # status quo ante |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
71 ... runcommand(server, [b'rollback', b'--config', b'ui.rollback=True']) |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
72 ... |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
73 ... # Current state |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
74 ... runcommand(server, [b'log', b'-T', b'{rev} {desc} ({topic})\n']) |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
75 *** runcommand log -T {rev} {desc} ({topic}) |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
76 |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
77 3 d () |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
78 2 c () |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
79 1 b () |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
80 0 a () |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
81 *** runcommand topic topic1 -r . |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
82 switching to topic topic1 |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
83 changed topic on 1 changesets to "topic1" |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
84 *** runcommand log -T {rev} {desc} ({topic}) |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
85 |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
86 4 d (topic1) |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
87 2 c () |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
88 1 b () |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
89 0 a () |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
90 *** runcommand rollback --config ui.rollback=True |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
91 repository tip rolled back to revision 3 (undo rewrite-topics) |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
92 working directory now based on revision 3 |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
93 *** runcommand log -T {rev} {desc} ({topic}) |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
94 |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
95 3 d () |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
96 2 c () |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
97 1 b () |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
98 0 a () |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
99 *** runcommand topic topic2 -r (.^^):: |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
100 switching to topic topic2 |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
101 changed topic on 3 changesets to "topic2" |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
102 *** runcommand log -T {rev} {desc} ({topic}) |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
103 |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
104 6 d (topic2) |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
105 5 c (topic2) |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
106 4 b (topic2) |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
107 0 a () |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
108 *** runcommand rollback --config ui.rollback=True |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
109 repository tip rolled back to revision 3 (undo rewrite-topics) |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
110 working directory now based on revision 3 |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
111 *** runcommand log -T {rev} {desc} ({topic}) |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
112 |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
113 3 d () |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
114 2 c () |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
115 1 b () |
b4f9b7e468ee
topic: invalidate the topic cache when branchcache is invalidated
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff
changeset
|
116 0 a () |