comparison tests/duplicates.t @ 45:237dd8c4fe78

Finalized separators
author Marcin Kasperski <Marcin.Kasperski@mekk.waw.pl>
date Sun, 25 Sep 2016 09:35:56 +0200
parents 2d6c7e0c1b2f
children 14a3ffbba22b
comparison
equal deleted inserted replaced
44:2d6c7e0c1b2f 45:237dd8c4fe78
1
2 Let's test what happens when some paths aren't unique.
3
4 Some locations used during testing:
5
6 $ WORK_DIR=${WORK_DIR-`pwd`/work}
7 $ rm -rf $WORK_DIR
8
9 $ export BASE=$WORK_DIR/base
10 $ export REP1=$WORK_DIR/rep1
11 $ export REP2=$WORK_DIR/rep2
12 $ export REP3=$WORK_DIR/rep3
13
14 First we need appropriate Mercurial configuration file (and variable
15 which ensures it is used).
16
17 $ export HGRCPATH=$WORK_DIR/hgrc
18 $ mkdir -p $HGRCPATH
19
20 $ cat > $HGRCPATH/basic.rc << EOF
21 > [ui]
22 > username = Andy Default <default@nowhere.net>
23 > [extensions]
24 > mercurial_all_paths =
25 > EOF
26
27 We need some repositories to test.
28
29 $ hg init "$BASE"
30 $ hg init "$REP1"
31 $ hg init "$REP2"
32 $ hg init "$REP3"
33
34 $ cat > $BASE/.hg/hgrc << EOF
35 > [paths]
36 > remote1=$REP1
37 > remote2=$REP2
38 > alias2=$REP2
39 > alias1=$REP1
40 > remote3=$REP3
41 > alias1again=$REP1
42 > EOF
43
44 Let's test pushing
45
46 $ cat > $BASE/file.txt << EOF
47 > Some text
48 > EOF
49
50 $ hg --cwd $BASE add
51 adding file.txt
52 $ hg --cwd $BASE commit -m 'First'
53
54 $ hg --cwd $BASE pushall
55 pushing to */rep1 (glob)
56 searching for changes
57 adding changesets
58 adding manifests
59 adding file changes
60 added 1 changesets with 1 changes to 1 files
61
62 pushing to */rep2 (glob)
63 searching for changes
64 adding changesets
65 adding manifests
66 adding file changes
67 added 1 changesets with 1 changes to 1 files
68
69 Skipping alias2 as path remote2 was already handled
70
71 Skipping alias1 as path remote1 was already handled
72
73 pushing to */rep3 (glob)
74 searching for changes
75 adding changesets
76 adding manifests
77 adding file changes
78 added 1 changesets with 1 changes to 1 files
79
80 Skipping alias1again as path remote1 was already handled
81
82 $ hg --cwd $REP1 log -T '{rev}: {desc}\n'
83 0: First
84
85 $ hg --cwd $REP2 log -T '{rev}: {desc}\n'
86 0: First
87
88 $ hg --cwd $REP3 log -T '{rev}: {desc}\n'
89 0: First
90
91 Let's also test pulling
92
93 $ hg --cwd $REP1 update
94 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
95
96 $ cat > $REP1/rep1.txt << EOF
97 > Another text
98 > EOF
99
100 $ hg --cwd $REP1 add
101 adding rep1.txt
102 $ hg --cwd $REP1 commit -m "In repo1"
103
104
105 $ hg --cwd $REP2 update
106 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
107
108 $ cat >> $REP2/file.txt << EOF
109 > From repo2…
110 > EOF
111
112 $ hg --cwd $REP2 add
113 $ hg --cwd $REP2 commit -m "In repo2"
114
115 $ hg --cwd $BASE incomingall
116 comparing with */rep1 (glob)
117 searching for changes
118 changeset: 1:* (glob)
119 tag: tip
120 user: Andy Default <default@nowhere.net>
121 date: .* (re)
122 summary: In repo1
123
124 comparing with */rep2 (glob)
125 searching for changes
126 changeset: 1:* (glob)
127 tag: tip
128 user: Andy Default <default@nowhere.net>
129 date: .* (re)
130 summary: In repo2
131
132 Skipping alias2 as path remote2 was already handled
133
134 Skipping alias1 as path remote1 was already handled
135
136 comparing with */rep3 (glob)
137 searching for changes
138 no changes found
139 Skipping alias1again as path remote1 was already handled
140
141 $ hg --cwd $BASE pullall
142 pulling from */rep1 (glob)
143 searching for changes
144 adding changesets
145 adding manifests
146 adding file changes
147 added 1 changesets with 1 changes to 1 files
148 (run 'hg update' to get a working copy)
149
150 pulling from */rep2 (glob)
151 searching for changes
152 adding changesets
153 adding manifests
154 adding file changes
155 added 1 changesets with 1 changes to 1 files (+1 heads)
156 (run 'hg heads' to see heads, 'hg merge' to merge)
157
158 Skipping alias2 as path remote2 was already handled
159
160 Skipping alias1 as path remote1 was already handled
161
162 pulling from */rep3 (glob)
163 searching for changes
164 no changes found
165
166 Skipping alias1again as path remote1 was already handled
167
168 $ hg --cwd $BASE log -T '{rev}: {desc}\n'
169 2: In repo2
170 1: In repo1
171 0: First
172
173 $ hg --cwd $BASE outgoingall
174 comparing with */rep1 (glob)
175 searching for changes
176 changeset: 2:.* (re)
177 tag: tip
178 parent: 0:.* (re)
179 user: Andy Default <default@nowhere.net>
180 date: .* (re)
181 summary: In repo2
182
183 comparing with */rep2 (glob)
184 searching for changes
185 changeset: 1:* (glob)
186 user: Andy Default <default@nowhere.net>
187 date: .* (re)
188 summary: In repo1
189
190 Skipping alias2 as path remote2 was already handled
191
192 Skipping alias1 as path remote1 was already handled
193
194 comparing with */rep3 (glob)
195 searching for changes
196 changeset: 1:* (glob)
197 user: Andy Default <default@nowhere.net>
198 date: .* (re)
199 summary: In repo1
200
201 changeset: 2:* (glob)
202 tag: tip
203 parent: 0:* (glob)
204 user: Andy Default <default@nowhere.net>
205 date: .* (re)
206 summary: In repo2
207
208 Skipping alias1again as path remote1 was already handled