|
1 $ . "$TESTDIR/testlib/topic_setup.sh" |
|
2 |
|
3 $ cat << EOF >> $HGRCPATH |
|
4 > [experimental] |
|
5 > evolution = all |
|
6 > topic.publish-bare-branch = yes |
|
7 > topic.server-gate-topic-changesets = yes |
|
8 > |
|
9 > [extensions] |
|
10 > evolve = |
|
11 > |
|
12 > [phases] |
|
13 > publish = no |
|
14 > |
|
15 > [ui] |
|
16 > ssh = "$PYTHON" "$RUNTESTDIR/dummyssh" |
|
17 > EOF |
|
18 |
|
19 $ hg init server |
|
20 $ cd server |
|
21 |
|
22 $ echo a > a |
|
23 $ hg commit -qAm root |
|
24 $ hg phase --public -r 'all()' |
|
25 |
|
26 $ cd .. |
|
27 |
|
28 $ hg clone ssh://user@dummy/server client-topic1 |
|
29 requesting all changes |
|
30 adding changesets |
|
31 adding manifests |
|
32 adding file changes |
|
33 added 1 changesets with 1 changes to 1 files |
|
34 new changesets 6569b5a81c7e |
|
35 updating to branch default |
|
36 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
37 $ hg clone ssh://user@dummy/server client-topic2 |
|
38 requesting all changes |
|
39 adding changesets |
|
40 adding manifests |
|
41 adding file changes |
|
42 added 1 changesets with 1 changes to 1 files |
|
43 new changesets 6569b5a81c7e |
|
44 updating to branch default |
|
45 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
46 $ hg version -v -R client-topic1 |
|
47 warning: --repository ignored |
|
48 Mercurial Distributed SCM (*) (glob) |
|
49 (see https://mercurial-scm.org for more information) |
|
50 |
|
51 Copyright (C) 2005-* Matt Mackall and others (glob) |
|
52 This is free software; see the source for copying conditions. There is NO |
|
53 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
54 |
|
55 Enabled extensions: |
|
56 |
|
57 rebase internal |
|
58 topic external * (glob) |
|
59 evolve external * (glob) |
|
60 $ hg clone ssh://user@dummy/server client-plain |
|
61 requesting all changes |
|
62 adding changesets |
|
63 adding manifests |
|
64 adding file changes |
|
65 added 1 changesets with 1 changes to 1 files |
|
66 new changesets 6569b5a81c7e |
|
67 updating to branch default |
|
68 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
69 $ cat << EOF >> client-plain/.hg/hgrc |
|
70 > [extensions] |
|
71 > topic = ! |
|
72 > EOF |
|
73 $ hg version -v -R client-plain |
|
74 warning: --repository ignored |
|
75 Mercurial Distributed SCM (*) (glob) |
|
76 (see https://mercurial-scm.org for more information) |
|
77 |
|
78 Copyright (C) 2005-* Matt Mackall and others (glob) |
|
79 This is free software; see the source for copying conditions. There is NO |
|
80 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
81 |
|
82 Enabled extensions: |
|
83 |
|
84 rebase internal |
|
85 evolve external * (glob) |
|
86 |
|
87 Make two commits, with and without a topic, and push them to the server |
|
88 |
|
89 $ cd client-topic1 |
|
90 $ echo b > b |
|
91 $ hg topic some-work |
|
92 marked working directory as topic: some-work |
|
93 $ hg commit -Am 'adding b (topic)' |
|
94 adding b |
|
95 active topic 'some-work' grew its first changeset |
|
96 (see 'hg help topics' for more information) |
|
97 $ hg up 0 |
|
98 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
99 $ echo c > c |
|
100 $ hg commit -Am 'adding c (no topic)' |
|
101 adding c |
|
102 $ hg log -r 'all() - 0' |
|
103 changeset: 1:2a2e8b3520f2 |
|
104 topic: some-work |
|
105 user: test |
|
106 date: Thu Jan 01 00:00:00 1970 +0000 |
|
107 summary: adding b (topic) |
|
108 |
|
109 changeset: 2:b46feb4d24f9 |
|
110 tag: tip |
|
111 parent: 0:6569b5a81c7e |
|
112 user: test |
|
113 date: Thu Jan 01 00:00:00 1970 +0000 |
|
114 summary: adding c (no topic) |
|
115 |
|
116 |
|
117 (disable the bare publishing to put a bare draft on the server) |
|
118 |
|
119 $ cat << EOF >> ../server/.hg/hgrc |
|
120 > [experimental] |
|
121 > topic.publish-bare-branch = no |
|
122 > EOF |
|
123 $ hg push |
|
124 pushing to ssh://user@dummy/server |
|
125 searching for changes |
|
126 remote: adding changesets |
|
127 remote: adding manifests |
|
128 remote: adding file changes |
|
129 remote: added 2 changesets with 2 changes to 2 files (+1 heads) |
|
130 $ cd .. |
|
131 $ hg --cwd server phase -r 'tip' |
|
132 2: draft |
|
133 |
|
134 Clients with topic can exchange draft changesets both with and without a topic through the server |
|
135 |
|
136 $ hg --cwd client-topic2 pull |
|
137 pulling from ssh://user@dummy/server |
|
138 searching for changes |
|
139 adding changesets |
|
140 adding manifests |
|
141 adding file changes |
|
142 added 2 changesets with 2 changes to 2 files (+1 heads) |
|
143 new changesets 2a2e8b3520f2:b46feb4d24f9 (2 drafts) |
|
144 (run 'hg heads' to see heads) |
|
145 $ hg --cwd client-topic2 log -r 'all() - 0' |
|
146 changeset: 1:2a2e8b3520f2 |
|
147 topic: some-work |
|
148 user: test |
|
149 date: Thu Jan 01 00:00:00 1970 +0000 |
|
150 summary: adding b (topic) |
|
151 |
|
152 changeset: 2:b46feb4d24f9 |
|
153 tag: tip |
|
154 parent: 0:6569b5a81c7e |
|
155 user: test |
|
156 date: Thu Jan 01 00:00:00 1970 +0000 |
|
157 summary: adding c (no topic) |
|
158 |
|
159 |
|
160 Client without topic only sees draft changesets if they don't have a topic |
|
161 |
|
162 $ hg --cwd client-plain pull |
|
163 pulling from ssh://user@dummy/server |
|
164 searching for changes |
|
165 adding changesets |
|
166 adding manifests |
|
167 adding file changes |
|
168 added 1 changesets with 1 changes to 1 files |
|
169 new changesets b46feb4d24f9 (1 drafts) |
|
170 (run 'hg update' to get a working copy) |
|
171 $ hg --cwd client-plain phase -r 'all() - 0' |
|
172 1: draft |
|
173 $ hg --cwd client-plain log -r 'all() - 0' |
|
174 changeset: 1:b46feb4d24f9 |
|
175 tag: tip |
|
176 user: test |
|
177 date: Thu Jan 01 00:00:00 1970 +0000 |
|
178 summary: adding c (no topic) |
|
179 |