##// END OF EJS Templates
test-tag: make hook runnable on Windows...
Matt Harbison -
r32019:bca8ad5c default
parent child Browse files
Show More
@@ -1,750 +1,749 b''
1 $ cat >> $HGRCPATH << EOF
1 $ cat >> $HGRCPATH << EOF
2 > [experimental]
2 > [experimental]
3 > hook-track-tags=1
3 > hook-track-tags=1
4 > [hooks]
4 > [hooks]
5 > txnclose.track-tag=${TESTTMP}/taghook.sh
5 > txnclose.track-tag=sh ${TESTTMP}/taghook.sh
6 > EOF
6 > EOF
7
7
8 $ cat << EOF > taghook.sh
8 $ cat << EOF > taghook.sh
9 > #!/bin/sh
9 > #!/bin/sh
10 > # escape the "$" otherwise the test runner interpret it when writting the
10 > # escape the "$" otherwise the test runner interpret it when writting the
11 > # file...
11 > # file...
12 > if [ -n "\$HG_TAG_MOVED" ]; then
12 > if [ -n "\$HG_TAG_MOVED" ]; then
13 > echo 'hook: tag changes detected'
13 > echo 'hook: tag changes detected'
14 > sed 's/^/hook: /' .hg/changes/tags.changes
14 > sed 's/^/hook: /' .hg/changes/tags.changes
15 > fi
15 > fi
16 > EOF
16 > EOF
17 $ chmod +x taghook.sh
18 $ hg init test
17 $ hg init test
19 $ cd test
18 $ cd test
20
19
21 $ echo a > a
20 $ echo a > a
22 $ hg add a
21 $ hg add a
23 $ hg commit -m "test"
22 $ hg commit -m "test"
24 $ hg history
23 $ hg history
25 changeset: 0:acb14030fe0a
24 changeset: 0:acb14030fe0a
26 tag: tip
25 tag: tip
27 user: test
26 user: test
28 date: Thu Jan 01 00:00:00 1970 +0000
27 date: Thu Jan 01 00:00:00 1970 +0000
29 summary: test
28 summary: test
30
29
31
30
32 $ hg tag ' '
31 $ hg tag ' '
33 abort: tag names cannot consist entirely of whitespace
32 abort: tag names cannot consist entirely of whitespace
34 [255]
33 [255]
35
34
36 (this tests also that editor is not invoked, if '--edit' is not
35 (this tests also that editor is not invoked, if '--edit' is not
37 specified)
36 specified)
38
37
39 $ HGEDITOR=cat hg tag "bleah"
38 $ HGEDITOR=cat hg tag "bleah"
40 hook: tag changes detected
39 hook: tag changes detected
41 hook: +A acb14030fe0a21b60322c440ad2d20cf7685a376 bleah
40 hook: +A acb14030fe0a21b60322c440ad2d20cf7685a376 bleah
42 $ hg history
41 $ hg history
43 changeset: 1:d4f0d2909abc
42 changeset: 1:d4f0d2909abc
44 tag: tip
43 tag: tip
45 user: test
44 user: test
46 date: Thu Jan 01 00:00:00 1970 +0000
45 date: Thu Jan 01 00:00:00 1970 +0000
47 summary: Added tag bleah for changeset acb14030fe0a
46 summary: Added tag bleah for changeset acb14030fe0a
48
47
49 changeset: 0:acb14030fe0a
48 changeset: 0:acb14030fe0a
50 tag: bleah
49 tag: bleah
51 user: test
50 user: test
52 date: Thu Jan 01 00:00:00 1970 +0000
51 date: Thu Jan 01 00:00:00 1970 +0000
53 summary: test
52 summary: test
54
53
55
54
56 $ echo foo >> .hgtags
55 $ echo foo >> .hgtags
57 $ hg tag "bleah2"
56 $ hg tag "bleah2"
58 abort: working copy of .hgtags is changed
57 abort: working copy of .hgtags is changed
59 (please commit .hgtags manually)
58 (please commit .hgtags manually)
60 [255]
59 [255]
61
60
62 $ hg revert .hgtags
61 $ hg revert .hgtags
63 $ hg tag -r 0 x y z y y z
62 $ hg tag -r 0 x y z y y z
64 abort: tag names must be unique
63 abort: tag names must be unique
65 [255]
64 [255]
66 $ hg tag tap nada dot tip
65 $ hg tag tap nada dot tip
67 abort: the name 'tip' is reserved
66 abort: the name 'tip' is reserved
68 [255]
67 [255]
69 $ hg tag .
68 $ hg tag .
70 abort: the name '.' is reserved
69 abort: the name '.' is reserved
71 [255]
70 [255]
72 $ hg tag null
71 $ hg tag null
73 abort: the name 'null' is reserved
72 abort: the name 'null' is reserved
74 [255]
73 [255]
75 $ hg tag "bleah"
74 $ hg tag "bleah"
76 abort: tag 'bleah' already exists (use -f to force)
75 abort: tag 'bleah' already exists (use -f to force)
77 [255]
76 [255]
78 $ hg tag "blecch" "bleah"
77 $ hg tag "blecch" "bleah"
79 abort: tag 'bleah' already exists (use -f to force)
78 abort: tag 'bleah' already exists (use -f to force)
80 [255]
79 [255]
81
80
82 $ hg tag --remove "blecch"
81 $ hg tag --remove "blecch"
83 abort: tag 'blecch' does not exist
82 abort: tag 'blecch' does not exist
84 [255]
83 [255]
85 $ hg tag --remove "bleah" "blecch" "blough"
84 $ hg tag --remove "bleah" "blecch" "blough"
86 abort: tag 'blecch' does not exist
85 abort: tag 'blecch' does not exist
87 [255]
86 [255]
88
87
89 $ hg tag -r 0 "bleah0"
88 $ hg tag -r 0 "bleah0"
90 hook: tag changes detected
89 hook: tag changes detected
91 hook: +A acb14030fe0a21b60322c440ad2d20cf7685a376 bleah0
90 hook: +A acb14030fe0a21b60322c440ad2d20cf7685a376 bleah0
92 $ hg tag -l -r 1 "bleah1"
91 $ hg tag -l -r 1 "bleah1"
93 $ hg tag gack gawk gorp
92 $ hg tag gack gawk gorp
94 hook: tag changes detected
93 hook: tag changes detected
95 hook: +A 336fccc858a4eb69609a291105009e484a6b6b8d gack
94 hook: +A 336fccc858a4eb69609a291105009e484a6b6b8d gack
96 hook: +A 336fccc858a4eb69609a291105009e484a6b6b8d gawk
95 hook: +A 336fccc858a4eb69609a291105009e484a6b6b8d gawk
97 hook: +A 336fccc858a4eb69609a291105009e484a6b6b8d gorp
96 hook: +A 336fccc858a4eb69609a291105009e484a6b6b8d gorp
98 $ hg tag -f gack
97 $ hg tag -f gack
99 hook: tag changes detected
98 hook: tag changes detected
100 hook: -M 336fccc858a4eb69609a291105009e484a6b6b8d gack
99 hook: -M 336fccc858a4eb69609a291105009e484a6b6b8d gack
101 hook: +M 799667b6f2d9b957f73fa644a918c2df22bab58f gack
100 hook: +M 799667b6f2d9b957f73fa644a918c2df22bab58f gack
102 $ hg tag --remove gack gorp
101 $ hg tag --remove gack gorp
103 hook: tag changes detected
102 hook: tag changes detected
104 hook: -R 799667b6f2d9b957f73fa644a918c2df22bab58f gack
103 hook: -R 799667b6f2d9b957f73fa644a918c2df22bab58f gack
105 hook: -R 336fccc858a4eb69609a291105009e484a6b6b8d gorp
104 hook: -R 336fccc858a4eb69609a291105009e484a6b6b8d gorp
106
105
107 $ hg tag "bleah "
106 $ hg tag "bleah "
108 abort: tag 'bleah' already exists (use -f to force)
107 abort: tag 'bleah' already exists (use -f to force)
109 [255]
108 [255]
110 $ hg tag " bleah"
109 $ hg tag " bleah"
111 abort: tag 'bleah' already exists (use -f to force)
110 abort: tag 'bleah' already exists (use -f to force)
112 [255]
111 [255]
113 $ hg tag " bleah"
112 $ hg tag " bleah"
114 abort: tag 'bleah' already exists (use -f to force)
113 abort: tag 'bleah' already exists (use -f to force)
115 [255]
114 [255]
116 $ hg tag -r 0 " bleahbleah "
115 $ hg tag -r 0 " bleahbleah "
117 hook: tag changes detected
116 hook: tag changes detected
118 hook: +A acb14030fe0a21b60322c440ad2d20cf7685a376 bleahbleah
117 hook: +A acb14030fe0a21b60322c440ad2d20cf7685a376 bleahbleah
119 $ hg tag -r 0 " bleah bleah "
118 $ hg tag -r 0 " bleah bleah "
120 hook: tag changes detected
119 hook: tag changes detected
121 hook: +A acb14030fe0a21b60322c440ad2d20cf7685a376 bleah bleah
120 hook: +A acb14030fe0a21b60322c440ad2d20cf7685a376 bleah bleah
122
121
123 $ cat .hgtags
122 $ cat .hgtags
124 acb14030fe0a21b60322c440ad2d20cf7685a376 bleah
123 acb14030fe0a21b60322c440ad2d20cf7685a376 bleah
125 acb14030fe0a21b60322c440ad2d20cf7685a376 bleah0
124 acb14030fe0a21b60322c440ad2d20cf7685a376 bleah0
126 336fccc858a4eb69609a291105009e484a6b6b8d gack
125 336fccc858a4eb69609a291105009e484a6b6b8d gack
127 336fccc858a4eb69609a291105009e484a6b6b8d gawk
126 336fccc858a4eb69609a291105009e484a6b6b8d gawk
128 336fccc858a4eb69609a291105009e484a6b6b8d gorp
127 336fccc858a4eb69609a291105009e484a6b6b8d gorp
129 336fccc858a4eb69609a291105009e484a6b6b8d gack
128 336fccc858a4eb69609a291105009e484a6b6b8d gack
130 799667b6f2d9b957f73fa644a918c2df22bab58f gack
129 799667b6f2d9b957f73fa644a918c2df22bab58f gack
131 799667b6f2d9b957f73fa644a918c2df22bab58f gack
130 799667b6f2d9b957f73fa644a918c2df22bab58f gack
132 0000000000000000000000000000000000000000 gack
131 0000000000000000000000000000000000000000 gack
133 336fccc858a4eb69609a291105009e484a6b6b8d gorp
132 336fccc858a4eb69609a291105009e484a6b6b8d gorp
134 0000000000000000000000000000000000000000 gorp
133 0000000000000000000000000000000000000000 gorp
135 acb14030fe0a21b60322c440ad2d20cf7685a376 bleahbleah
134 acb14030fe0a21b60322c440ad2d20cf7685a376 bleahbleah
136 acb14030fe0a21b60322c440ad2d20cf7685a376 bleah bleah
135 acb14030fe0a21b60322c440ad2d20cf7685a376 bleah bleah
137
136
138 $ cat .hg/localtags
137 $ cat .hg/localtags
139 d4f0d2909abc9290e2773c08837d70c1794e3f5a bleah1
138 d4f0d2909abc9290e2773c08837d70c1794e3f5a bleah1
140
139
141 tagging on a non-head revision
140 tagging on a non-head revision
142
141
143 $ hg update 0
142 $ hg update 0
144 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
143 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
145 $ hg tag -l localblah
144 $ hg tag -l localblah
146 $ hg tag "foobar"
145 $ hg tag "foobar"
147 abort: working directory is not at a branch head (use -f to force)
146 abort: working directory is not at a branch head (use -f to force)
148 [255]
147 [255]
149 $ hg tag -f "foobar"
148 $ hg tag -f "foobar"
150 hook: tag changes detected
149 hook: tag changes detected
151 hook: +A acb14030fe0a21b60322c440ad2d20cf7685a376 foobar
150 hook: +A acb14030fe0a21b60322c440ad2d20cf7685a376 foobar
152 $ cat .hgtags
151 $ cat .hgtags
153 acb14030fe0a21b60322c440ad2d20cf7685a376 foobar
152 acb14030fe0a21b60322c440ad2d20cf7685a376 foobar
154 $ cat .hg/localtags
153 $ cat .hg/localtags
155 d4f0d2909abc9290e2773c08837d70c1794e3f5a bleah1
154 d4f0d2909abc9290e2773c08837d70c1794e3f5a bleah1
156 acb14030fe0a21b60322c440ad2d20cf7685a376 localblah
155 acb14030fe0a21b60322c440ad2d20cf7685a376 localblah
157
156
158 $ hg tag -l 'xx
157 $ hg tag -l 'xx
159 > newline'
158 > newline'
160 abort: '\n' cannot be used in a name
159 abort: '\n' cannot be used in a name
161 [255]
160 [255]
162 $ hg tag -l 'xx:xx'
161 $ hg tag -l 'xx:xx'
163 abort: ':' cannot be used in a name
162 abort: ':' cannot be used in a name
164 [255]
163 [255]
165
164
166 cloning local tags
165 cloning local tags
167
166
168 $ cd ..
167 $ cd ..
169 $ hg -R test log -r0:5
168 $ hg -R test log -r0:5
170 changeset: 0:acb14030fe0a
169 changeset: 0:acb14030fe0a
171 tag: bleah
170 tag: bleah
172 tag: bleah bleah
171 tag: bleah bleah
173 tag: bleah0
172 tag: bleah0
174 tag: bleahbleah
173 tag: bleahbleah
175 tag: foobar
174 tag: foobar
176 tag: localblah
175 tag: localblah
177 user: test
176 user: test
178 date: Thu Jan 01 00:00:00 1970 +0000
177 date: Thu Jan 01 00:00:00 1970 +0000
179 summary: test
178 summary: test
180
179
181 changeset: 1:d4f0d2909abc
180 changeset: 1:d4f0d2909abc
182 tag: bleah1
181 tag: bleah1
183 user: test
182 user: test
184 date: Thu Jan 01 00:00:00 1970 +0000
183 date: Thu Jan 01 00:00:00 1970 +0000
185 summary: Added tag bleah for changeset acb14030fe0a
184 summary: Added tag bleah for changeset acb14030fe0a
186
185
187 changeset: 2:336fccc858a4
186 changeset: 2:336fccc858a4
188 tag: gawk
187 tag: gawk
189 user: test
188 user: test
190 date: Thu Jan 01 00:00:00 1970 +0000
189 date: Thu Jan 01 00:00:00 1970 +0000
191 summary: Added tag bleah0 for changeset acb14030fe0a
190 summary: Added tag bleah0 for changeset acb14030fe0a
192
191
193 changeset: 3:799667b6f2d9
192 changeset: 3:799667b6f2d9
194 user: test
193 user: test
195 date: Thu Jan 01 00:00:00 1970 +0000
194 date: Thu Jan 01 00:00:00 1970 +0000
196 summary: Added tag gack, gawk, gorp for changeset 336fccc858a4
195 summary: Added tag gack, gawk, gorp for changeset 336fccc858a4
197
196
198 changeset: 4:154eeb7c0138
197 changeset: 4:154eeb7c0138
199 user: test
198 user: test
200 date: Thu Jan 01 00:00:00 1970 +0000
199 date: Thu Jan 01 00:00:00 1970 +0000
201 summary: Added tag gack for changeset 799667b6f2d9
200 summary: Added tag gack for changeset 799667b6f2d9
202
201
203 changeset: 5:b4bb47aaff09
202 changeset: 5:b4bb47aaff09
204 user: test
203 user: test
205 date: Thu Jan 01 00:00:00 1970 +0000
204 date: Thu Jan 01 00:00:00 1970 +0000
206 summary: Removed tag gack, gorp
205 summary: Removed tag gack, gorp
207
206
208 $ hg clone -q -rbleah1 test test1
207 $ hg clone -q -rbleah1 test test1
209 hook: tag changes detected
208 hook: tag changes detected
210 hook: +A acb14030fe0a21b60322c440ad2d20cf7685a376 bleah
209 hook: +A acb14030fe0a21b60322c440ad2d20cf7685a376 bleah
211 $ hg -R test1 parents --style=compact
210 $ hg -R test1 parents --style=compact
212 1[tip] d4f0d2909abc 1970-01-01 00:00 +0000 test
211 1[tip] d4f0d2909abc 1970-01-01 00:00 +0000 test
213 Added tag bleah for changeset acb14030fe0a
212 Added tag bleah for changeset acb14030fe0a
214
213
215 $ hg clone -q -r5 test#bleah1 test2
214 $ hg clone -q -r5 test#bleah1 test2
216 hook: tag changes detected
215 hook: tag changes detected
217 hook: +A acb14030fe0a21b60322c440ad2d20cf7685a376 bleah
216 hook: +A acb14030fe0a21b60322c440ad2d20cf7685a376 bleah
218 hook: +A acb14030fe0a21b60322c440ad2d20cf7685a376 bleah0
217 hook: +A acb14030fe0a21b60322c440ad2d20cf7685a376 bleah0
219 hook: +A 336fccc858a4eb69609a291105009e484a6b6b8d gawk
218 hook: +A 336fccc858a4eb69609a291105009e484a6b6b8d gawk
220 $ hg -R test2 parents --style=compact
219 $ hg -R test2 parents --style=compact
221 5[tip] b4bb47aaff09 1970-01-01 00:00 +0000 test
220 5[tip] b4bb47aaff09 1970-01-01 00:00 +0000 test
222 Removed tag gack, gorp
221 Removed tag gack, gorp
223
222
224 $ hg clone -q -U test#bleah1 test3
223 $ hg clone -q -U test#bleah1 test3
225 hook: tag changes detected
224 hook: tag changes detected
226 hook: +A acb14030fe0a21b60322c440ad2d20cf7685a376 bleah
225 hook: +A acb14030fe0a21b60322c440ad2d20cf7685a376 bleah
227 $ hg -R test3 parents --style=compact
226 $ hg -R test3 parents --style=compact
228
227
229 $ cd test
228 $ cd test
230
229
231 Issue601: hg tag doesn't do the right thing if .hgtags or localtags
230 Issue601: hg tag doesn't do the right thing if .hgtags or localtags
232 doesn't end with EOL
231 doesn't end with EOL
233
232
234 $ python << EOF
233 $ python << EOF
235 > f = file('.hg/localtags'); last = f.readlines()[-1][:-1]; f.close()
234 > f = file('.hg/localtags'); last = f.readlines()[-1][:-1]; f.close()
236 > f = file('.hg/localtags', 'w'); f.write(last); f.close()
235 > f = file('.hg/localtags', 'w'); f.write(last); f.close()
237 > EOF
236 > EOF
238 $ cat .hg/localtags; echo
237 $ cat .hg/localtags; echo
239 acb14030fe0a21b60322c440ad2d20cf7685a376 localblah
238 acb14030fe0a21b60322c440ad2d20cf7685a376 localblah
240 $ hg tag -l localnewline
239 $ hg tag -l localnewline
241 $ cat .hg/localtags; echo
240 $ cat .hg/localtags; echo
242 acb14030fe0a21b60322c440ad2d20cf7685a376 localblah
241 acb14030fe0a21b60322c440ad2d20cf7685a376 localblah
243 c2899151f4e76890c602a2597a650a72666681bf localnewline
242 c2899151f4e76890c602a2597a650a72666681bf localnewline
244
243
245
244
246 $ python << EOF
245 $ python << EOF
247 > f = file('.hgtags'); last = f.readlines()[-1][:-1]; f.close()
246 > f = file('.hgtags'); last = f.readlines()[-1][:-1]; f.close()
248 > f = file('.hgtags', 'w'); f.write(last); f.close()
247 > f = file('.hgtags', 'w'); f.write(last); f.close()
249 > EOF
248 > EOF
250 $ hg ci -m'broken manual edit of .hgtags'
249 $ hg ci -m'broken manual edit of .hgtags'
251 $ cat .hgtags; echo
250 $ cat .hgtags; echo
252 acb14030fe0a21b60322c440ad2d20cf7685a376 foobar
251 acb14030fe0a21b60322c440ad2d20cf7685a376 foobar
253 $ hg tag newline
252 $ hg tag newline
254 hook: tag changes detected
253 hook: tag changes detected
255 hook: +A a0eea09de1eeec777b46f2085260a373b2fbc293 newline
254 hook: +A a0eea09de1eeec777b46f2085260a373b2fbc293 newline
256 $ cat .hgtags; echo
255 $ cat .hgtags; echo
257 acb14030fe0a21b60322c440ad2d20cf7685a376 foobar
256 acb14030fe0a21b60322c440ad2d20cf7685a376 foobar
258 a0eea09de1eeec777b46f2085260a373b2fbc293 newline
257 a0eea09de1eeec777b46f2085260a373b2fbc293 newline
259
258
260
259
261 tag and branch using same name
260 tag and branch using same name
262
261
263 $ hg branch tag-and-branch-same-name
262 $ hg branch tag-and-branch-same-name
264 marked working directory as branch tag-and-branch-same-name
263 marked working directory as branch tag-and-branch-same-name
265 (branches are permanent and global, did you want a bookmark?)
264 (branches are permanent and global, did you want a bookmark?)
266 $ hg ci -m"discouraged"
265 $ hg ci -m"discouraged"
267 $ hg tag tag-and-branch-same-name
266 $ hg tag tag-and-branch-same-name
268 warning: tag tag-and-branch-same-name conflicts with existing branch name
267 warning: tag tag-and-branch-same-name conflicts with existing branch name
269 hook: tag changes detected
268 hook: tag changes detected
270 hook: +A fc93d2ea1cd78e91216c6cfbbf26747c10ce11ae tag-and-branch-same-name
269 hook: +A fc93d2ea1cd78e91216c6cfbbf26747c10ce11ae tag-and-branch-same-name
271
270
272 test custom commit messages
271 test custom commit messages
273
272
274 $ cat > editor.sh << '__EOF__'
273 $ cat > editor.sh << '__EOF__'
275 > echo "==== before editing"
274 > echo "==== before editing"
276 > cat "$1"
275 > cat "$1"
277 > echo "===="
276 > echo "===="
278 > echo "custom tag message" > "$1"
277 > echo "custom tag message" > "$1"
279 > echo "second line" >> "$1"
278 > echo "second line" >> "$1"
280 > __EOF__
279 > __EOF__
281
280
282 at first, test saving last-message.txt
281 at first, test saving last-message.txt
283
282
284 (test that editor is not invoked before transaction starting)
283 (test that editor is not invoked before transaction starting)
285
284
286 $ cat > .hg/hgrc << '__EOF__'
285 $ cat > .hg/hgrc << '__EOF__'
287 > [hooks]
286 > [hooks]
288 > # this failure occurs before editor invocation
287 > # this failure occurs before editor invocation
289 > pretag.test-saving-lastmessage = false
288 > pretag.test-saving-lastmessage = false
290 > __EOF__
289 > __EOF__
291 $ rm -f .hg/last-message.txt
290 $ rm -f .hg/last-message.txt
292 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg tag custom-tag -e
291 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg tag custom-tag -e
293 abort: pretag.test-saving-lastmessage hook exited with status 1
292 abort: pretag.test-saving-lastmessage hook exited with status 1
294 [255]
293 [255]
295 $ test -f .hg/last-message.txt
294 $ test -f .hg/last-message.txt
296 [1]
295 [1]
297
296
298 (test that editor is invoked and commit message is saved into
297 (test that editor is invoked and commit message is saved into
299 "last-message.txt")
298 "last-message.txt")
300
299
301 $ cat >> .hg/hgrc << '__EOF__'
300 $ cat >> .hg/hgrc << '__EOF__'
302 > [hooks]
301 > [hooks]
303 > pretag.test-saving-lastmessage =
302 > pretag.test-saving-lastmessage =
304 > # this failure occurs after editor invocation
303 > # this failure occurs after editor invocation
305 > pretxncommit.unexpectedabort = false
304 > pretxncommit.unexpectedabort = false
306 > __EOF__
305 > __EOF__
307
306
308 (this tests also that editor is invoked, if '--edit' is specified,
307 (this tests also that editor is invoked, if '--edit' is specified,
309 regardless of '--message')
308 regardless of '--message')
310
309
311 $ rm -f .hg/last-message.txt
310 $ rm -f .hg/last-message.txt
312 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg tag custom-tag -e -m "foo bar"
311 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg tag custom-tag -e -m "foo bar"
313 ==== before editing
312 ==== before editing
314 foo bar
313 foo bar
315
314
316
315
317 HG: Enter commit message. Lines beginning with 'HG:' are removed.
316 HG: Enter commit message. Lines beginning with 'HG:' are removed.
318 HG: Leave message empty to abort commit.
317 HG: Leave message empty to abort commit.
319 HG: --
318 HG: --
320 HG: user: test
319 HG: user: test
321 HG: branch 'tag-and-branch-same-name'
320 HG: branch 'tag-and-branch-same-name'
322 HG: changed .hgtags
321 HG: changed .hgtags
323 ====
322 ====
324 note: commit message saved in .hg/last-message.txt
323 note: commit message saved in .hg/last-message.txt
325 transaction abort!
324 transaction abort!
326 rollback completed
325 rollback completed
327 abort: pretxncommit.unexpectedabort hook exited with status 1
326 abort: pretxncommit.unexpectedabort hook exited with status 1
328 [255]
327 [255]
329 $ cat .hg/last-message.txt
328 $ cat .hg/last-message.txt
330 custom tag message
329 custom tag message
331 second line
330 second line
332
331
333 $ cat >> .hg/hgrc << '__EOF__'
332 $ cat >> .hg/hgrc << '__EOF__'
334 > [hooks]
333 > [hooks]
335 > pretxncommit.unexpectedabort =
334 > pretxncommit.unexpectedabort =
336 > __EOF__
335 > __EOF__
337 $ hg status .hgtags
336 $ hg status .hgtags
338 M .hgtags
337 M .hgtags
339 $ hg revert --no-backup -q .hgtags
338 $ hg revert --no-backup -q .hgtags
340
339
341 then, test custom commit message itself
340 then, test custom commit message itself
342
341
343 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg tag custom-tag -e
342 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg tag custom-tag -e
344 ==== before editing
343 ==== before editing
345 Added tag custom-tag for changeset 75a534207be6
344 Added tag custom-tag for changeset 75a534207be6
346
345
347
346
348 HG: Enter commit message. Lines beginning with 'HG:' are removed.
347 HG: Enter commit message. Lines beginning with 'HG:' are removed.
349 HG: Leave message empty to abort commit.
348 HG: Leave message empty to abort commit.
350 HG: --
349 HG: --
351 HG: user: test
350 HG: user: test
352 HG: branch 'tag-and-branch-same-name'
351 HG: branch 'tag-and-branch-same-name'
353 HG: changed .hgtags
352 HG: changed .hgtags
354 ====
353 ====
355 hook: tag changes detected
354 hook: tag changes detected
356 hook: +A 75a534207be6b03576e0c7a4fa5708d045f1c876 custom-tag
355 hook: +A 75a534207be6b03576e0c7a4fa5708d045f1c876 custom-tag
357 $ hg log -l1 --template "{desc}\n"
356 $ hg log -l1 --template "{desc}\n"
358 custom tag message
357 custom tag message
359 second line
358 second line
360
359
361
360
362 local tag with .hgtags modified
361 local tag with .hgtags modified
363
362
364 $ hg tag hgtags-modified
363 $ hg tag hgtags-modified
365 hook: tag changes detected
364 hook: tag changes detected
366 hook: +A 0f26aaea6f74c3ed6c4aad8844403c9ba128d23a hgtags-modified
365 hook: +A 0f26aaea6f74c3ed6c4aad8844403c9ba128d23a hgtags-modified
367 $ hg rollback
366 $ hg rollback
368 repository tip rolled back to revision 13 (undo commit)
367 repository tip rolled back to revision 13 (undo commit)
369 working directory now based on revision 13
368 working directory now based on revision 13
370 $ hg st
369 $ hg st
371 M .hgtags
370 M .hgtags
372 ? .hgtags.orig
371 ? .hgtags.orig
373 ? editor.sh
372 ? editor.sh
374 $ hg tag --local baz
373 $ hg tag --local baz
375 $ hg revert --no-backup .hgtags
374 $ hg revert --no-backup .hgtags
376
375
377
376
378 tagging when at named-branch-head that's not a topo-head
377 tagging when at named-branch-head that's not a topo-head
379
378
380 $ hg up default
379 $ hg up default
381 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
380 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
382 $ hg merge -t internal:local
381 $ hg merge -t internal:local
383 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
382 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
384 (branch merge, don't forget to commit)
383 (branch merge, don't forget to commit)
385 $ hg ci -m 'merge named branch'
384 $ hg ci -m 'merge named branch'
386 hook: tag changes detected
385 hook: tag changes detected
387 hook: -R acb14030fe0a21b60322c440ad2d20cf7685a376 bleah
386 hook: -R acb14030fe0a21b60322c440ad2d20cf7685a376 bleah
388 hook: -R acb14030fe0a21b60322c440ad2d20cf7685a376 bleah bleah
387 hook: -R acb14030fe0a21b60322c440ad2d20cf7685a376 bleah bleah
389 hook: -R acb14030fe0a21b60322c440ad2d20cf7685a376 bleah0
388 hook: -R acb14030fe0a21b60322c440ad2d20cf7685a376 bleah0
390 hook: -R acb14030fe0a21b60322c440ad2d20cf7685a376 bleahbleah
389 hook: -R acb14030fe0a21b60322c440ad2d20cf7685a376 bleahbleah
391 hook: -R 336fccc858a4eb69609a291105009e484a6b6b8d gawk
390 hook: -R 336fccc858a4eb69609a291105009e484a6b6b8d gawk
392 $ hg up 13
391 $ hg up 13
393 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
392 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
394 $ hg tag new-topo-head
393 $ hg tag new-topo-head
395 hook: tag changes detected
394 hook: tag changes detected
396 hook: +A 0f26aaea6f74c3ed6c4aad8844403c9ba128d23a new-topo-head
395 hook: +A 0f26aaea6f74c3ed6c4aad8844403c9ba128d23a new-topo-head
397
396
398 tagging on null rev
397 tagging on null rev
399
398
400 $ hg up null
399 $ hg up null
401 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
400 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
402 $ hg tag nullrev
401 $ hg tag nullrev
403 abort: working directory is not at a branch head (use -f to force)
402 abort: working directory is not at a branch head (use -f to force)
404 [255]
403 [255]
405
404
406 $ hg init empty
405 $ hg init empty
407 $ hg tag -R empty nullrev
406 $ hg tag -R empty nullrev
408 abort: cannot tag null revision
407 abort: cannot tag null revision
409 [255]
408 [255]
410
409
411 $ hg tag -R empty -r 00000000000 -f nulltag
410 $ hg tag -R empty -r 00000000000 -f nulltag
412 abort: cannot tag null revision
411 abort: cannot tag null revision
413 [255]
412 [255]
414
413
415 $ cd ..
414 $ cd ..
416
415
417 tagging on an uncommitted merge (issue2542)
416 tagging on an uncommitted merge (issue2542)
418
417
419 $ hg init repo-tag-uncommitted-merge
418 $ hg init repo-tag-uncommitted-merge
420 $ cd repo-tag-uncommitted-merge
419 $ cd repo-tag-uncommitted-merge
421 $ echo c1 > f1
420 $ echo c1 > f1
422 $ hg ci -Am0
421 $ hg ci -Am0
423 adding f1
422 adding f1
424 $ echo c2 > f2
423 $ echo c2 > f2
425 $ hg ci -Am1
424 $ hg ci -Am1
426 adding f2
425 adding f2
427 $ hg co -q 0
426 $ hg co -q 0
428 $ hg branch b1
427 $ hg branch b1
429 marked working directory as branch b1
428 marked working directory as branch b1
430 (branches are permanent and global, did you want a bookmark?)
429 (branches are permanent and global, did you want a bookmark?)
431 $ hg ci -m2
430 $ hg ci -m2
432 $ hg up default
431 $ hg up default
433 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
432 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
434 $ hg merge b1
433 $ hg merge b1
435 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
434 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
436 (branch merge, don't forget to commit)
435 (branch merge, don't forget to commit)
437
436
438 $ hg tag t1
437 $ hg tag t1
439 abort: uncommitted merge
438 abort: uncommitted merge
440 [255]
439 [255]
441 $ hg status
440 $ hg status
442 $ hg tag --rev 1 t2
441 $ hg tag --rev 1 t2
443 abort: uncommitted merge
442 abort: uncommitted merge
444 [255]
443 [255]
445 $ hg tag --rev 1 --local t3
444 $ hg tag --rev 1 --local t3
446 $ hg tags -v
445 $ hg tags -v
447 tip 2:2a156e8887cc
446 tip 2:2a156e8887cc
448 t3 1:c3adabd1a5f4 local
447 t3 1:c3adabd1a5f4 local
449
448
450 $ cd ..
449 $ cd ..
451
450
452 commit hook on tag used to be run without write lock - issue3344
451 commit hook on tag used to be run without write lock - issue3344
453
452
454 $ hg init repo-tag
453 $ hg init repo-tag
455 $ touch repo-tag/test
454 $ touch repo-tag/test
456 $ hg -R repo-tag commit -A -m "test"
455 $ hg -R repo-tag commit -A -m "test"
457 adding test
456 adding test
458 $ hg init repo-tag-target
457 $ hg init repo-tag-target
459 $ cat > "$TESTTMP/issue3344.sh" <<EOF
458 $ cat > "$TESTTMP/issue3344.sh" <<EOF
460 > hg push "$TESTTMP/repo-tag-target"
459 > hg push "$TESTTMP/repo-tag-target"
461 > EOF
460 > EOF
462 $ hg -R repo-tag --config hooks.commit="sh ../issue3344.sh" tag tag
461 $ hg -R repo-tag --config hooks.commit="sh ../issue3344.sh" tag tag
463 hook: tag changes detected
462 hook: tag changes detected
464 hook: +A be090ea6625635128e90f7d89df8beeb2bcc1653 tag
463 hook: +A be090ea6625635128e90f7d89df8beeb2bcc1653 tag
465 pushing to $TESTTMP/repo-tag-target (glob)
464 pushing to $TESTTMP/repo-tag-target (glob)
466 searching for changes
465 searching for changes
467 adding changesets
466 adding changesets
468 adding manifests
467 adding manifests
469 adding file changes
468 adding file changes
470 added 2 changesets with 2 changes to 2 files
469 added 2 changesets with 2 changes to 2 files
471 hook: tag changes detected
470 hook: tag changes detected
472 hook: +A be090ea6625635128e90f7d89df8beeb2bcc1653 tag
471 hook: +A be090ea6625635128e90f7d89df8beeb2bcc1653 tag
473
472
474 automatically merge resolvable tag conflicts (i.e. tags that differ in rank)
473 automatically merge resolvable tag conflicts (i.e. tags that differ in rank)
475 create two clones with some different tags as well as some common tags
474 create two clones with some different tags as well as some common tags
476 check that we can merge tags that differ in rank
475 check that we can merge tags that differ in rank
477
476
478 $ hg init repo-automatic-tag-merge
477 $ hg init repo-automatic-tag-merge
479 $ cd repo-automatic-tag-merge
478 $ cd repo-automatic-tag-merge
480 $ echo c0 > f0
479 $ echo c0 > f0
481 $ hg ci -A -m0
480 $ hg ci -A -m0
482 adding f0
481 adding f0
483 $ hg tag tbase
482 $ hg tag tbase
484 hook: tag changes detected
483 hook: tag changes detected
485 hook: +A 6cee5c8f3e5b4ae1a3996d2f6489c3e08eb5aea7 tbase
484 hook: +A 6cee5c8f3e5b4ae1a3996d2f6489c3e08eb5aea7 tbase
486 $ hg up -qr '.^'
485 $ hg up -qr '.^'
487 $ hg log -r 'wdir()' -T "{latesttagdistance}\n"
486 $ hg log -r 'wdir()' -T "{latesttagdistance}\n"
488 1
487 1
489 $ hg up -q
488 $ hg up -q
490 $ hg log -r 'wdir()' -T "{latesttagdistance}\n"
489 $ hg log -r 'wdir()' -T "{latesttagdistance}\n"
491 2
490 2
492 $ cd ..
491 $ cd ..
493 $ hg clone repo-automatic-tag-merge repo-automatic-tag-merge-clone
492 $ hg clone repo-automatic-tag-merge repo-automatic-tag-merge-clone
494 updating to branch default
493 updating to branch default
495 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
494 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
496 $ cd repo-automatic-tag-merge-clone
495 $ cd repo-automatic-tag-merge-clone
497 $ echo c1 > f1
496 $ echo c1 > f1
498 $ hg ci -A -m1
497 $ hg ci -A -m1
499 adding f1
498 adding f1
500 $ hg tag t1 t2 t3
499 $ hg tag t1 t2 t3
501 hook: tag changes detected
500 hook: tag changes detected
502 hook: +A 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t1
501 hook: +A 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t1
503 hook: +A 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2
502 hook: +A 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2
504 hook: +A 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3
503 hook: +A 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3
505 $ hg tag --remove t2
504 $ hg tag --remove t2
506 hook: tag changes detected
505 hook: tag changes detected
507 hook: -R 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2
506 hook: -R 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2
508 $ hg tag t5
507 $ hg tag t5
509 hook: tag changes detected
508 hook: tag changes detected
510 hook: +A 875517b4806a848f942811a315a5bce30804ae85 t5
509 hook: +A 875517b4806a848f942811a315a5bce30804ae85 t5
511 $ echo c2 > f2
510 $ echo c2 > f2
512 $ hg ci -A -m2
511 $ hg ci -A -m2
513 adding f2
512 adding f2
514 $ hg tag -f t3
513 $ hg tag -f t3
515 hook: tag changes detected
514 hook: tag changes detected
516 hook: -M 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3
515 hook: -M 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3
517 hook: +M 79505d5360b07e3e79d1052e347e73c02b8afa5b t3
516 hook: +M 79505d5360b07e3e79d1052e347e73c02b8afa5b t3
518
517
519 $ cd ../repo-automatic-tag-merge
518 $ cd ../repo-automatic-tag-merge
520 $ echo c3 > f3
519 $ echo c3 > f3
521 $ hg ci -A -m3
520 $ hg ci -A -m3
522 adding f3
521 adding f3
523 $ hg tag -f t4 t5 t6
522 $ hg tag -f t4 t5 t6
524 hook: tag changes detected
523 hook: tag changes detected
525 hook: +A 9aa4e1292a27a248f8d07339bed9931d54907be7 t4
524 hook: +A 9aa4e1292a27a248f8d07339bed9931d54907be7 t4
526 hook: +A 9aa4e1292a27a248f8d07339bed9931d54907be7 t5
525 hook: +A 9aa4e1292a27a248f8d07339bed9931d54907be7 t5
527 hook: +A 9aa4e1292a27a248f8d07339bed9931d54907be7 t6
526 hook: +A 9aa4e1292a27a248f8d07339bed9931d54907be7 t6
528
527
529 $ hg up -q '.^'
528 $ hg up -q '.^'
530 $ hg log -r 'wdir()' -T "{changessincelatesttag} changes since {latesttag}\n"
529 $ hg log -r 'wdir()' -T "{changessincelatesttag} changes since {latesttag}\n"
531 1 changes since t4:t5:t6
530 1 changes since t4:t5:t6
532 $ hg log -r '.' -T "{changessincelatesttag} changes since {latesttag}\n"
531 $ hg log -r '.' -T "{changessincelatesttag} changes since {latesttag}\n"
533 0 changes since t4:t5:t6
532 0 changes since t4:t5:t6
534 $ echo c5 > f3
533 $ echo c5 > f3
535 $ hg log -r 'wdir()' -T "{changessincelatesttag} changes since {latesttag}\n"
534 $ hg log -r 'wdir()' -T "{changessincelatesttag} changes since {latesttag}\n"
536 1 changes since t4:t5:t6
535 1 changes since t4:t5:t6
537 $ hg up -qC
536 $ hg up -qC
538
537
539 $ hg tag --remove t5
538 $ hg tag --remove t5
540 hook: tag changes detected
539 hook: tag changes detected
541 hook: -R 9aa4e1292a27a248f8d07339bed9931d54907be7 t5
540 hook: -R 9aa4e1292a27a248f8d07339bed9931d54907be7 t5
542 $ echo c4 > f4
541 $ echo c4 > f4
543 $ hg log -r '.' -T "{changessincelatesttag} changes since {latesttag}\n"
542 $ hg log -r '.' -T "{changessincelatesttag} changes since {latesttag}\n"
544 2 changes since t4:t6
543 2 changes since t4:t6
545 $ hg log -r '.' -T "{latesttag % '{latesttag}\n'}"
544 $ hg log -r '.' -T "{latesttag % '{latesttag}\n'}"
546 t4
545 t4
547 t6
546 t6
548 $ hg log -r '.' -T "{latesttag('t4') % 'T: {tag}, C: {changes}, D: {distance}\n'}"
547 $ hg log -r '.' -T "{latesttag('t4') % 'T: {tag}, C: {changes}, D: {distance}\n'}"
549 T: t4, C: 2, D: 2
548 T: t4, C: 2, D: 2
550 $ hg log -r '.' -T "{latesttag('re:\d') % 'T: {tag}, C: {changes}, D: {distance}\n'}"
549 $ hg log -r '.' -T "{latesttag('re:\d') % 'T: {tag}, C: {changes}, D: {distance}\n'}"
551 T: t4, C: 2, D: 2
550 T: t4, C: 2, D: 2
552 T: t6, C: 2, D: 2
551 T: t6, C: 2, D: 2
553 $ hg log -r . -T '{join(latesttag(), "*")}\n'
552 $ hg log -r . -T '{join(latesttag(), "*")}\n'
554 t4*t6
553 t4*t6
555 $ hg ci -A -m4
554 $ hg ci -A -m4
556 adding f4
555 adding f4
557 $ hg log -r 'wdir()' -T "{changessincelatesttag} changes since {latesttag}\n"
556 $ hg log -r 'wdir()' -T "{changessincelatesttag} changes since {latesttag}\n"
558 4 changes since t4:t6
557 4 changes since t4:t6
559 $ hg tag t2
558 $ hg tag t2
560 hook: tag changes detected
559 hook: tag changes detected
561 hook: +A 929bca7b18d067cbf3844c3896319a940059d748 t2
560 hook: +A 929bca7b18d067cbf3844c3896319a940059d748 t2
562 $ hg tag -f t6
561 $ hg tag -f t6
563 hook: tag changes detected
562 hook: tag changes detected
564 hook: -M 9aa4e1292a27a248f8d07339bed9931d54907be7 t6
563 hook: -M 9aa4e1292a27a248f8d07339bed9931d54907be7 t6
565 hook: +M 09af2ce14077a94effef208b49a718f4836d4338 t6
564 hook: +M 09af2ce14077a94effef208b49a718f4836d4338 t6
566
565
567 $ cd ../repo-automatic-tag-merge-clone
566 $ cd ../repo-automatic-tag-merge-clone
568 $ hg pull
567 $ hg pull
569 pulling from $TESTTMP/repo-automatic-tag-merge (glob)
568 pulling from $TESTTMP/repo-automatic-tag-merge (glob)
570 searching for changes
569 searching for changes
571 adding changesets
570 adding changesets
572 adding manifests
571 adding manifests
573 adding file changes
572 adding file changes
574 added 6 changesets with 6 changes to 3 files (+1 heads)
573 added 6 changesets with 6 changes to 3 files (+1 heads)
575 hook: tag changes detected
574 hook: tag changes detected
576 hook: +A 929bca7b18d067cbf3844c3896319a940059d748 t2
575 hook: +A 929bca7b18d067cbf3844c3896319a940059d748 t2
577 hook: +A 9aa4e1292a27a248f8d07339bed9931d54907be7 t4
576 hook: +A 9aa4e1292a27a248f8d07339bed9931d54907be7 t4
578 hook: -R 875517b4806a848f942811a315a5bce30804ae85 t5
577 hook: -R 875517b4806a848f942811a315a5bce30804ae85 t5
579 hook: +A 09af2ce14077a94effef208b49a718f4836d4338 t6
578 hook: +A 09af2ce14077a94effef208b49a718f4836d4338 t6
580 (run 'hg heads' to see heads, 'hg merge' to merge)
579 (run 'hg heads' to see heads, 'hg merge' to merge)
581 $ hg merge --tool internal:tagmerge
580 $ hg merge --tool internal:tagmerge
582 merging .hgtags
581 merging .hgtags
583 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
582 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
584 (branch merge, don't forget to commit)
583 (branch merge, don't forget to commit)
585 $ hg status
584 $ hg status
586 M .hgtags
585 M .hgtags
587 M f3
586 M f3
588 M f4
587 M f4
589 $ hg resolve -l
588 $ hg resolve -l
590 R .hgtags
589 R .hgtags
591 $ cat .hgtags
590 $ cat .hgtags
592 9aa4e1292a27a248f8d07339bed9931d54907be7 t4
591 9aa4e1292a27a248f8d07339bed9931d54907be7 t4
593 9aa4e1292a27a248f8d07339bed9931d54907be7 t6
592 9aa4e1292a27a248f8d07339bed9931d54907be7 t6
594 9aa4e1292a27a248f8d07339bed9931d54907be7 t6
593 9aa4e1292a27a248f8d07339bed9931d54907be7 t6
595 09af2ce14077a94effef208b49a718f4836d4338 t6
594 09af2ce14077a94effef208b49a718f4836d4338 t6
596 6cee5c8f3e5b4ae1a3996d2f6489c3e08eb5aea7 tbase
595 6cee5c8f3e5b4ae1a3996d2f6489c3e08eb5aea7 tbase
597 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t1
596 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t1
598 929bca7b18d067cbf3844c3896319a940059d748 t2
597 929bca7b18d067cbf3844c3896319a940059d748 t2
599 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2
598 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2
600 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3
599 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3
601 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2
600 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2
602 0000000000000000000000000000000000000000 t2
601 0000000000000000000000000000000000000000 t2
603 875517b4806a848f942811a315a5bce30804ae85 t5
602 875517b4806a848f942811a315a5bce30804ae85 t5
604 9aa4e1292a27a248f8d07339bed9931d54907be7 t5
603 9aa4e1292a27a248f8d07339bed9931d54907be7 t5
605 9aa4e1292a27a248f8d07339bed9931d54907be7 t5
604 9aa4e1292a27a248f8d07339bed9931d54907be7 t5
606 0000000000000000000000000000000000000000 t5
605 0000000000000000000000000000000000000000 t5
607 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3
606 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3
608 79505d5360b07e3e79d1052e347e73c02b8afa5b t3
607 79505d5360b07e3e79d1052e347e73c02b8afa5b t3
609
608
610 check that the merge tried to minimize the diff with the first merge parent
609 check that the merge tried to minimize the diff with the first merge parent
611
610
612 $ hg diff --git -r 'p1()' .hgtags
611 $ hg diff --git -r 'p1()' .hgtags
613 diff --git a/.hgtags b/.hgtags
612 diff --git a/.hgtags b/.hgtags
614 --- a/.hgtags
613 --- a/.hgtags
615 +++ b/.hgtags
614 +++ b/.hgtags
616 @@ -1,9 +1,17 @@
615 @@ -1,9 +1,17 @@
617 +9aa4e1292a27a248f8d07339bed9931d54907be7 t4
616 +9aa4e1292a27a248f8d07339bed9931d54907be7 t4
618 +9aa4e1292a27a248f8d07339bed9931d54907be7 t6
617 +9aa4e1292a27a248f8d07339bed9931d54907be7 t6
619 +9aa4e1292a27a248f8d07339bed9931d54907be7 t6
618 +9aa4e1292a27a248f8d07339bed9931d54907be7 t6
620 +09af2ce14077a94effef208b49a718f4836d4338 t6
619 +09af2ce14077a94effef208b49a718f4836d4338 t6
621 6cee5c8f3e5b4ae1a3996d2f6489c3e08eb5aea7 tbase
620 6cee5c8f3e5b4ae1a3996d2f6489c3e08eb5aea7 tbase
622 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t1
621 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t1
623 +929bca7b18d067cbf3844c3896319a940059d748 t2
622 +929bca7b18d067cbf3844c3896319a940059d748 t2
624 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2
623 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2
625 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3
624 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3
626 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2
625 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2
627 0000000000000000000000000000000000000000 t2
626 0000000000000000000000000000000000000000 t2
628 875517b4806a848f942811a315a5bce30804ae85 t5
627 875517b4806a848f942811a315a5bce30804ae85 t5
629 +9aa4e1292a27a248f8d07339bed9931d54907be7 t5
628 +9aa4e1292a27a248f8d07339bed9931d54907be7 t5
630 +9aa4e1292a27a248f8d07339bed9931d54907be7 t5
629 +9aa4e1292a27a248f8d07339bed9931d54907be7 t5
631 +0000000000000000000000000000000000000000 t5
630 +0000000000000000000000000000000000000000 t5
632 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3
631 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3
633 79505d5360b07e3e79d1052e347e73c02b8afa5b t3
632 79505d5360b07e3e79d1052e347e73c02b8afa5b t3
634
633
635 detect merge tag conflicts
634 detect merge tag conflicts
636
635
637 $ hg update -C -r tip
636 $ hg update -C -r tip
638 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
637 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
639 $ hg tag t7
638 $ hg tag t7
640 hook: tag changes detected
639 hook: tag changes detected
641 hook: +A b325cc5b642c5b465bdbe8c09627cb372de3d47d t7
640 hook: +A b325cc5b642c5b465bdbe8c09627cb372de3d47d t7
642 $ hg update -C -r 'first(sort(head()))'
641 $ hg update -C -r 'first(sort(head()))'
643 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
642 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
644 $ printf "%s %s\n" `hg log -r . --template "{node} t7"` >> .hgtags
643 $ printf "%s %s\n" `hg log -r . --template "{node} t7"` >> .hgtags
645 $ hg commit -m "manually add conflicting t7 tag"
644 $ hg commit -m "manually add conflicting t7 tag"
646 hook: tag changes detected
645 hook: tag changes detected
647 hook: -R 929bca7b18d067cbf3844c3896319a940059d748 t2
646 hook: -R 929bca7b18d067cbf3844c3896319a940059d748 t2
648 hook: +A 875517b4806a848f942811a315a5bce30804ae85 t5
647 hook: +A 875517b4806a848f942811a315a5bce30804ae85 t5
649 hook: -M b325cc5b642c5b465bdbe8c09627cb372de3d47d t7
648 hook: -M b325cc5b642c5b465bdbe8c09627cb372de3d47d t7
650 hook: +M ea918d56be86a4afc5a95312e8b6750e1428d9d2 t7
649 hook: +M ea918d56be86a4afc5a95312e8b6750e1428d9d2 t7
651 $ hg merge --tool internal:tagmerge
650 $ hg merge --tool internal:tagmerge
652 merging .hgtags
651 merging .hgtags
653 automatic .hgtags merge failed
652 automatic .hgtags merge failed
654 the following 1 tags are in conflict: t7
653 the following 1 tags are in conflict: t7
655 automatic tag merging of .hgtags failed! (use 'hg resolve --tool :merge' or another merge tool of your choice)
654 automatic tag merging of .hgtags failed! (use 'hg resolve --tool :merge' or another merge tool of your choice)
656 2 files updated, 0 files merged, 0 files removed, 1 files unresolved
655 2 files updated, 0 files merged, 0 files removed, 1 files unresolved
657 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
656 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
658 [1]
657 [1]
659 $ hg resolve -l
658 $ hg resolve -l
660 U .hgtags
659 U .hgtags
661 $ cat .hgtags
660 $ cat .hgtags
662 6cee5c8f3e5b4ae1a3996d2f6489c3e08eb5aea7 tbase
661 6cee5c8f3e5b4ae1a3996d2f6489c3e08eb5aea7 tbase
663 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t1
662 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t1
664 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2
663 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2
665 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3
664 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3
666 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2
665 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2
667 0000000000000000000000000000000000000000 t2
666 0000000000000000000000000000000000000000 t2
668 875517b4806a848f942811a315a5bce30804ae85 t5
667 875517b4806a848f942811a315a5bce30804ae85 t5
669 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3
668 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3
670 79505d5360b07e3e79d1052e347e73c02b8afa5b t3
669 79505d5360b07e3e79d1052e347e73c02b8afa5b t3
671 ea918d56be86a4afc5a95312e8b6750e1428d9d2 t7
670 ea918d56be86a4afc5a95312e8b6750e1428d9d2 t7
672
671
673 $ cd ..
672 $ cd ..
674
673
675 handle the loss of tags
674 handle the loss of tags
676
675
677 $ hg clone repo-automatic-tag-merge-clone repo-merge-lost-tags
676 $ hg clone repo-automatic-tag-merge-clone repo-merge-lost-tags
678 updating to branch default
677 updating to branch default
679 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
678 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
680 $ cd repo-merge-lost-tags
679 $ cd repo-merge-lost-tags
681 $ echo c5 > f5
680 $ echo c5 > f5
682 $ hg ci -A -m5
681 $ hg ci -A -m5
683 adding f5
682 adding f5
684 $ hg tag -f t7
683 $ hg tag -f t7
685 hook: tag changes detected
684 hook: tag changes detected
686 hook: -M ea918d56be86a4afc5a95312e8b6750e1428d9d2 t7
685 hook: -M ea918d56be86a4afc5a95312e8b6750e1428d9d2 t7
687 hook: +M fd3a9e394ce3afb354a496323bf68ac1755a30de t7
686 hook: +M fd3a9e394ce3afb354a496323bf68ac1755a30de t7
688 $ hg update -r 'p1(t7)'
687 $ hg update -r 'p1(t7)'
689 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
688 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
690 $ printf '' > .hgtags
689 $ printf '' > .hgtags
691 $ hg commit -m 'delete all tags'
690 $ hg commit -m 'delete all tags'
692 created new head
691 created new head
693 $ hg log -r 'max(t7::)'
692 $ hg log -r 'max(t7::)'
694 changeset: 17:ffe462b50880
693 changeset: 17:ffe462b50880
695 user: test
694 user: test
696 date: Thu Jan 01 00:00:00 1970 +0000
695 date: Thu Jan 01 00:00:00 1970 +0000
697 summary: Added tag t7 for changeset fd3a9e394ce3
696 summary: Added tag t7 for changeset fd3a9e394ce3
698
697
699 $ hg update -r 'max(t7::)'
698 $ hg update -r 'max(t7::)'
700 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
699 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
701 $ hg merge -r tip --tool internal:tagmerge
700 $ hg merge -r tip --tool internal:tagmerge
702 merging .hgtags
701 merging .hgtags
703 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
702 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
704 (branch merge, don't forget to commit)
703 (branch merge, don't forget to commit)
705 $ hg resolve -l
704 $ hg resolve -l
706 R .hgtags
705 R .hgtags
707 $ cat .hgtags
706 $ cat .hgtags
708 6cee5c8f3e5b4ae1a3996d2f6489c3e08eb5aea7 tbase
707 6cee5c8f3e5b4ae1a3996d2f6489c3e08eb5aea7 tbase
709 0000000000000000000000000000000000000000 tbase
708 0000000000000000000000000000000000000000 tbase
710 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t1
709 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t1
711 0000000000000000000000000000000000000000 t1
710 0000000000000000000000000000000000000000 t1
712 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2
711 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2
713 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3
712 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3
714 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2
713 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2
715 0000000000000000000000000000000000000000 t2
714 0000000000000000000000000000000000000000 t2
716 875517b4806a848f942811a315a5bce30804ae85 t5
715 875517b4806a848f942811a315a5bce30804ae85 t5
717 0000000000000000000000000000000000000000 t5
716 0000000000000000000000000000000000000000 t5
718 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3
717 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3
719 79505d5360b07e3e79d1052e347e73c02b8afa5b t3
718 79505d5360b07e3e79d1052e347e73c02b8afa5b t3
720 0000000000000000000000000000000000000000 t3
719 0000000000000000000000000000000000000000 t3
721 ea918d56be86a4afc5a95312e8b6750e1428d9d2 t7
720 ea918d56be86a4afc5a95312e8b6750e1428d9d2 t7
722 0000000000000000000000000000000000000000 t7
721 0000000000000000000000000000000000000000 t7
723 ea918d56be86a4afc5a95312e8b6750e1428d9d2 t7
722 ea918d56be86a4afc5a95312e8b6750e1428d9d2 t7
724 fd3a9e394ce3afb354a496323bf68ac1755a30de t7
723 fd3a9e394ce3afb354a496323bf68ac1755a30de t7
725
724
726 also check that we minimize the diff with the 1st merge parent
725 also check that we minimize the diff with the 1st merge parent
727
726
728 $ hg diff --git -r 'p1()' .hgtags
727 $ hg diff --git -r 'p1()' .hgtags
729 diff --git a/.hgtags b/.hgtags
728 diff --git a/.hgtags b/.hgtags
730 --- a/.hgtags
729 --- a/.hgtags
731 +++ b/.hgtags
730 +++ b/.hgtags
732 @@ -1,12 +1,17 @@
731 @@ -1,12 +1,17 @@
733 6cee5c8f3e5b4ae1a3996d2f6489c3e08eb5aea7 tbase
732 6cee5c8f3e5b4ae1a3996d2f6489c3e08eb5aea7 tbase
734 +0000000000000000000000000000000000000000 tbase
733 +0000000000000000000000000000000000000000 tbase
735 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t1
734 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t1
736 +0000000000000000000000000000000000000000 t1
735 +0000000000000000000000000000000000000000 t1
737 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2
736 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2
738 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3
737 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3
739 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2
738 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2
740 0000000000000000000000000000000000000000 t2
739 0000000000000000000000000000000000000000 t2
741 875517b4806a848f942811a315a5bce30804ae85 t5
740 875517b4806a848f942811a315a5bce30804ae85 t5
742 +0000000000000000000000000000000000000000 t5
741 +0000000000000000000000000000000000000000 t5
743 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3
742 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3
744 79505d5360b07e3e79d1052e347e73c02b8afa5b t3
743 79505d5360b07e3e79d1052e347e73c02b8afa5b t3
745 +0000000000000000000000000000000000000000 t3
744 +0000000000000000000000000000000000000000 t3
746 ea918d56be86a4afc5a95312e8b6750e1428d9d2 t7
745 ea918d56be86a4afc5a95312e8b6750e1428d9d2 t7
747 +0000000000000000000000000000000000000000 t7
746 +0000000000000000000000000000000000000000 t7
748 ea918d56be86a4afc5a95312e8b6750e1428d9d2 t7
747 ea918d56be86a4afc5a95312e8b6750e1428d9d2 t7
749 fd3a9e394ce3afb354a496323bf68ac1755a30de t7
748 fd3a9e394ce3afb354a496323bf68ac1755a30de t7
750
749
General Comments 0
You need to be logged in to leave comments. Login now