##// END OF EJS Templates
py3: make test-commit-multiple.t byte-safe
Yuya Nishihara -
r36803:e2c0c088 default
parent child Browse files
Show More
@@ -1,395 +1,396 b''
1 1 test-abort-checkin.t
2 2 test-add.t
3 3 test-addremove-similar.t
4 4 test-addremove.t
5 5 test-amend-subrepo.t
6 6 test-ancestor.py
7 7 test-annotate.py
8 8 test-annotate.t
9 9 test-archive-symlinks.t
10 10 test-atomictempfile.py
11 11 test-audit-path.t
12 12 test-audit-subrepo.t
13 13 test-automv.t
14 14 test-backout.t
15 15 test-backwards-remove.t
16 16 test-basic.t
17 17 test-bheads.t
18 18 test-bisect2.t
19 19 test-blackbox.t
20 20 test-bookmarks-current.t
21 21 test-bookmarks-merge.t
22 22 test-bookmarks-rebase.t
23 23 test-bookmarks-strip.t
24 24 test-bookmarks.t
25 25 test-branch-option.t
26 26 test-branch-tag-confict.t
27 27 test-branches.t
28 28 test-bundle-phases.t
29 29 test-bundle-type.t
30 30 test-bundle-vs-outgoing.t
31 31 test-bundle2-multiple-changegroups.t
32 32 test-cappedreader.py
33 33 test-casecollision.t
34 34 test-cat.t
35 35 test-censor.t
36 36 test-changelog-exec.t
37 37 test-check-commit.t
38 38 test-check-execute.t
39 39 test-check-module-imports.t
40 40 test-check-pyflakes.t
41 41 test-check-pylint.t
42 42 test-check-shbang.t
43 43 test-children.t
44 44 test-clone-pull-corruption.t
45 45 test-clone-r.t
46 46 test-clone-update-order.t
47 47 test-command-template.t
48 48 test-commit-amend.t
49 test-commit-multiple.t
49 50 test-commit-unresolved.t
50 51 test-commit.t
51 52 test-committer.t
52 53 test-completion.t
53 54 test-config-env.py
54 55 test-config.t
55 56 test-conflict.t
56 57 test-confused-revert.t
57 58 test-contrib-check-code.t
58 59 test-contrib-check-commit.t
59 60 test-convert-authormap.t
60 61 test-convert-clonebranches.t
61 62 test-convert-datesort.t
62 63 test-convert-filemap.t
63 64 test-convert-hg-sink.t
64 65 test-convert-hg-source.t
65 66 test-convert-hg-startrev.t
66 67 test-copy-move-merge.t
67 68 test-copy.t
68 69 test-copytrace-heuristics.t
69 70 test-debugbuilddag.t
70 71 test-debugbundle.t
71 72 test-debugextensions.t
72 73 test-debugindexdot.t
73 74 test-debugrename.t
74 75 test-default-push.t
75 76 test-diff-binary-file.t
76 77 test-diff-change.t
77 78 test-diff-copy-depth.t
78 79 test-diff-hashes.t
79 80 test-diff-issue2761.t
80 81 test-diff-newlines.t
81 82 test-diff-reverse.t
82 83 test-diff-subdir.t
83 84 test-diffdir.t
84 85 test-directaccess.t
85 86 test-dirstate-backup.t
86 87 test-dirstate-nonnormalset.t
87 88 test-doctest.py
88 89 test-double-merge.t
89 90 test-drawdag.t
90 91 test-duplicateoptions.py
91 92 test-empty-dir.t
92 93 test-empty-file.t
93 94 test-empty-group.t
94 95 test-empty.t
95 96 test-encode.t
96 97 test-encoding-func.py
97 98 test-encoding.t
98 99 test-eol-add.t
99 100 test-eol-clone.t
100 101 test-eol-hook.t
101 102 test-eol-tag.t
102 103 test-eol-update.t
103 104 test-excessive-merge.t
104 105 test-exchange-obsmarkers-case-A1.t
105 106 test-exchange-obsmarkers-case-A2.t
106 107 test-exchange-obsmarkers-case-A3.t
107 108 test-exchange-obsmarkers-case-A4.t
108 109 test-exchange-obsmarkers-case-A5.t
109 110 test-exchange-obsmarkers-case-A6.t
110 111 test-exchange-obsmarkers-case-A7.t
111 112 test-exchange-obsmarkers-case-B1.t
112 113 test-exchange-obsmarkers-case-B2.t
113 114 test-exchange-obsmarkers-case-B3.t
114 115 test-exchange-obsmarkers-case-B4.t
115 116 test-exchange-obsmarkers-case-B5.t
116 117 test-exchange-obsmarkers-case-B6.t
117 118 test-exchange-obsmarkers-case-B7.t
118 119 test-exchange-obsmarkers-case-C1.t
119 120 test-exchange-obsmarkers-case-C2.t
120 121 test-exchange-obsmarkers-case-C3.t
121 122 test-exchange-obsmarkers-case-C4.t
122 123 test-exchange-obsmarkers-case-D1.t
123 124 test-exchange-obsmarkers-case-D2.t
124 125 test-exchange-obsmarkers-case-D3.t
125 126 test-exchange-obsmarkers-case-D4.t
126 127 test-execute-bit.t
127 128 test-extdiff.t
128 129 test-extra-filelog-entry.t
129 130 test-filebranch.t
130 131 test-fileset-generated.t
131 132 test-flags.t
132 133 test-generaldelta.t
133 134 test-getbundle.t
134 135 test-git-export.t
135 136 test-glog-topological.t
136 137 test-gpg.t
137 138 test-graft.t
138 139 test-hghave.t
139 140 test-hgignore.t
140 141 test-hgk.t
141 142 test-hgweb-bundle.t
142 143 test-hgweb-descend-empties.t
143 144 test-hgweb-removed.t
144 145 test-histedit-arguments.t
145 146 test-histedit-base.t
146 147 test-histedit-bookmark-motion.t
147 148 test-histedit-commute.t
148 149 test-histedit-drop.t
149 150 test-histedit-edit.t
150 151 test-histedit-fold-non-commute.t
151 152 test-histedit-fold.t
152 153 test-histedit-no-change.t
153 154 test-histedit-non-commute-abort.t
154 155 test-histedit-non-commute.t
155 156 test-histedit-obsolete.t
156 157 test-histedit-outgoing.t
157 158 test-histedit-templates.t
158 159 test-http-branchmap.t
159 160 test-http-bundle1.t
160 161 test-http-clone-r.t
161 162 test-identify.t
162 163 test-import-unknown.t
163 164 test-imports-checker.t
164 165 test-inherit-mode.t
165 166 test-issue1089.t
166 167 test-issue1102.t
167 168 test-issue1175.t
168 169 test-issue1306.t
169 170 test-issue1438.t
170 171 test-issue1502.t
171 172 test-issue1802.t
172 173 test-issue1877.t
173 174 test-issue1993.t
174 175 test-issue2137.t
175 176 test-issue3084.t
176 177 test-issue4074.t
177 178 test-issue522.t
178 179 test-issue586.t
179 180 test-issue612.t
180 181 test-issue619.t
181 182 test-issue672.t
182 183 test-issue842.t
183 184 test-journal-exists.t
184 185 test-largefiles-cache.t
185 186 test-largefiles-misc.t
186 187 test-largefiles-small-disk.t
187 188 test-locate.t
188 189 test-lock-badness.t
189 190 test-log.t
190 191 test-logexchange.t
191 192 test-lrucachedict.py
192 193 test-mactext.t
193 194 test-manifest-merging.t
194 195 test-manifest.py
195 196 test-manifest.t
196 197 test-match.py
197 198 test-mdiff.py
198 199 test-merge-closedheads.t
199 200 test-merge-commit.t
200 201 test-merge-criss-cross.t
201 202 test-merge-default.t
202 203 test-merge-internal-tools-pattern.t
203 204 test-merge-local.t
204 205 test-merge-remove.t
205 206 test-merge-revert.t
206 207 test-merge-revert2.t
207 208 test-merge-subrepos.t
208 209 test-merge-symlinks.t
209 210 test-merge-types.t
210 211 test-merge1.t
211 212 test-merge10.t
212 213 test-merge2.t
213 214 test-merge4.t
214 215 test-merge5.t
215 216 test-merge6.t
216 217 test-merge7.t
217 218 test-merge8.t
218 219 test-merge9.t
219 220 test-mq-git.t
220 221 test-mq-header-date.t
221 222 test-mq-header-from.t
222 223 test-mq-pull-from-bundle.t
223 224 test-mq-qdiff.t
224 225 test-mq-qfold.t
225 226 test-mq-qgoto.t
226 227 test-mq-qimport-fail-cleanup.t
227 228 test-mq-qpush-exact.t
228 229 test-mq-qqueue.t
229 230 test-mq-qrefresh-replace-log-message.t
230 231 test-mq-qrefresh.t
231 232 test-mq-qrename.t
232 233 test-mq-qsave.t
233 234 test-mq-safety.t
234 235 test-mq-symlinks.t
235 236 test-mv-cp-st-diff.t
236 237 test-narrow-archive.t
237 238 test-narrow-clone-no-ellipsis.t
238 239 test-narrow-clone-nonlinear.t
239 240 test-narrow-clone.t
240 241 test-narrow-commit.t
241 242 test-narrow-copies.t
242 243 test-narrow-debugcommands.t
243 244 test-narrow-debugrebuilddirstate.t
244 245 test-narrow-exchange-merges.t
245 246 test-narrow-exchange.t
246 247 test-narrow-expanddirstate.t
247 248 test-narrow-merge.t
248 249 test-narrow-patch.t
249 250 test-narrow-patterns.t
250 251 test-narrow-pull.t
251 252 test-narrow-rebase.t
252 253 test-narrow-shallow-merges.t
253 254 test-narrow-shallow.t
254 255 test-narrow-strip.t
255 256 test-narrow-update.t
256 257 test-nested-repo.t
257 258 test-newbranch.t
258 259 test-obshistory.t
259 260 test-obsmarker-template.t
260 261 test-obsmarkers-effectflag.t
261 262 test-obsolete-bundle-strip.t
262 263 test-obsolete-changeset-exchange.t
263 264 test-obsolete-checkheads.t
264 265 test-obsolete-distributed.t
265 266 test-obsolete-tag-cache.t
266 267 test-parents.t
267 268 test-pathconflicts-merge.t
268 269 test-pathconflicts-update.t
269 270 test-pending.t
270 271 test-permissions.t
271 272 test-phases.t
272 273 test-pull-branch.t
273 274 test-pull-http.t
274 275 test-pull-permission.t
275 276 test-pull-pull-corruption.t
276 277 test-pull-r.t
277 278 test-pull-update.t
278 279 test-purge.t
279 280 test-push-checkheads-partial-C1.t
280 281 test-push-checkheads-partial-C2.t
281 282 test-push-checkheads-partial-C3.t
282 283 test-push-checkheads-partial-C4.t
283 284 test-push-checkheads-pruned-B1.t
284 285 test-push-checkheads-pruned-B2.t
285 286 test-push-checkheads-pruned-B3.t
286 287 test-push-checkheads-pruned-B4.t
287 288 test-push-checkheads-pruned-B5.t
288 289 test-push-checkheads-pruned-B6.t
289 290 test-push-checkheads-pruned-B7.t
290 291 test-push-checkheads-pruned-B8.t
291 292 test-push-checkheads-superceed-A1.t
292 293 test-push-checkheads-superceed-A2.t
293 294 test-push-checkheads-superceed-A3.t
294 295 test-push-checkheads-superceed-A4.t
295 296 test-push-checkheads-superceed-A5.t
296 297 test-push-checkheads-superceed-A6.t
297 298 test-push-checkheads-superceed-A7.t
298 299 test-push-checkheads-superceed-A8.t
299 300 test-push-checkheads-unpushed-D1.t
300 301 test-push-checkheads-unpushed-D2.t
301 302 test-push-checkheads-unpushed-D3.t
302 303 test-push-checkheads-unpushed-D4.t
303 304 test-push-checkheads-unpushed-D5.t
304 305 test-push-checkheads-unpushed-D6.t
305 306 test-push-checkheads-unpushed-D7.t
306 307 test-push-http.t
307 308 test-push-warn.t
308 309 test-pushvars.t
309 310 test-rebase-abort.t
310 311 test-rebase-base-flag.t
311 312 test-rebase-bookmarks.t
312 313 test-rebase-brute-force.t
313 314 test-rebase-cache.t
314 315 test-rebase-check-restore.t
315 316 test-rebase-collapse.t
316 317 test-rebase-dest.t
317 318 test-rebase-detach.t
318 319 test-rebase-emptycommit.t
319 320 test-rebase-inmemory.t
320 321 test-rebase-interruptions.t
321 322 test-rebase-issue-noparam-single-rev.t
322 323 test-rebase-legacy.t
323 324 test-rebase-mq-skip.t
324 325 test-rebase-named-branches.t
325 326 test-rebase-newancestor.t
326 327 test-rebase-obsolete.t
327 328 test-rebase-parameters.t
328 329 test-rebase-partial.t
329 330 test-rebase-pull.t
330 331 test-rebase-rename.t
331 332 test-rebase-scenario-global.t
332 333 test-rebase-templates.t
333 334 test-rebase-transaction.t
334 335 test-record.t
335 336 test-relink.t
336 337 test-remove.t
337 338 test-rename-after-merge.t
338 339 test-rename-dir-merge.t
339 340 test-rename-merge1.t
340 341 test-rename.t
341 342 test-repair-strip.t
342 343 test-repo-compengines.t
343 344 test-resolve.t
344 345 test-revert-flags.t
345 346 test-revert-unknown.t
346 347 test-revlog-ancestry.py
347 348 test-revlog-group-emptyiter.t
348 349 test-revlog-mmapindex.t
349 350 test-revlog-packentry.t
350 351 test-revset-dirstate-parents.t
351 352 test-revset-outgoing.t
352 353 test-rollback.t
353 354 test-run-tests.py
354 355 test-schemes.t
355 356 test-serve.t
356 357 test-share.t
357 358 test-show-stack.t
358 359 test-show-work.t
359 360 test-show.t
360 361 test-simple-update.t
361 362 test-single-head.t
362 363 test-sparse-clear.t
363 364 test-sparse-merges.t
364 365 test-sparse-requirement.t
365 366 test-sparse-verbose-json.t
366 367 test-ssh-clone-r.t
367 368 test-ssh-proto.t
368 369 test-sshserver.py
369 370 test-status-rev.t
370 371 test-status-terse.t
371 372 test-strip-cross.t
372 373 test-strip.t
373 374 test-subrepo-deep-nested-change.t
374 375 test-subrepo.t
375 376 test-symlinks.t
376 377 test-tag.t
377 378 test-tags.t
378 379 test-treemanifest.t
379 380 test-unamend.t
380 381 test-uncommit.t
381 382 test-unified-test.t
382 383 test-unrelated-pull.t
383 384 test-up-local-change.t
384 385 test-update-branches.t
385 386 test-update-dest.t
386 387 test-update-issue1456.t
387 388 test-update-names.t
388 389 test-update-reverse.t
389 390 test-upgrade-repo.t
390 391 test-url-rev.t
391 392 test-username-newline.t
392 393 test-verify.t
393 394 test-websub.t
394 395 test-win32text.t
395 396 test-xdg.t
@@ -1,131 +1,133 b''
1 1 # reproduce issue2264, issue2516
2 2
3 3 create test repo
4 4 $ cat <<EOF >> $HGRCPATH
5 5 > [extensions]
6 6 > transplant =
7 7 > EOF
8 8 $ hg init repo
9 9 $ cd repo
10 10 $ template="{rev} {desc|firstline} [{branch}]\n"
11 11
12 12 # we need to start out with two changesets on the default branch
13 13 # in order to avoid the cute little optimization where transplant
14 14 # pulls rather than transplants
15 15 add initial changesets
16 16 $ echo feature1 > file1
17 17 $ hg ci -Am"feature 1"
18 18 adding file1
19 19 $ echo feature2 >> file2
20 20 $ hg ci -Am"feature 2"
21 21 adding file2
22 22
23 23 # The changes to 'bugfix' are enough to show the bug: in fact, with only
24 24 # those changes, it's a very noisy crash ("RuntimeError: nothing
25 25 # committed after transplant"). But if we modify a second file in the
26 26 # transplanted changesets, the bug is much more subtle: transplant
27 27 # silently drops the second change to 'bugfix' on the floor, and we only
28 28 # see it when we run 'hg status' after transplanting. Subtle data loss
29 29 # bugs are worse than crashes, so reproduce the subtle case here.
30 30 commit bug fixes on bug fix branch
31 31 $ hg branch fixes
32 32 marked working directory as branch fixes
33 33 (branches are permanent and global, did you want a bookmark?)
34 34 $ echo fix1 > bugfix
35 35 $ echo fix1 >> file1
36 36 $ hg ci -Am"fix 1"
37 37 adding bugfix
38 38 $ echo fix2 > bugfix
39 39 $ echo fix2 >> file1
40 40 $ hg ci -Am"fix 2"
41 41 $ hg log -G --template="$template"
42 42 @ 3 fix 2 [fixes]
43 43 |
44 44 o 2 fix 1 [fixes]
45 45 |
46 46 o 1 feature 2 [default]
47 47 |
48 48 o 0 feature 1 [default]
49 49
50 50 transplant bug fixes onto release branch
51 51 $ hg update 0
52 52 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
53 53 $ hg branch release
54 54 marked working directory as branch release
55 55 $ hg transplant 2 3
56 56 applying [0-9a-f]{12} (re)
57 57 [0-9a-f]{12} transplanted to [0-9a-f]{12} (re)
58 58 applying [0-9a-f]{12} (re)
59 59 [0-9a-f]{12} transplanted to [0-9a-f]{12} (re)
60 60 $ hg log -G --template="$template"
61 61 @ 5 fix 2 [release]
62 62 |
63 63 o 4 fix 1 [release]
64 64 |
65 65 | o 3 fix 2 [fixes]
66 66 | |
67 67 | o 2 fix 1 [fixes]
68 68 | |
69 69 | o 1 feature 2 [default]
70 70 |/
71 71 o 0 feature 1 [default]
72 72
73 73 $ hg status
74 74 $ hg status --rev 0:4
75 75 M file1
76 76 A bugfix
77 77 $ hg status --rev 4:5
78 78 M bugfix
79 79 M file1
80 80
81 81 now test that we fixed the bug for all scripts/extensions
82 82 $ cat > $TESTTMP/committwice.py <<__EOF__
83 83 > from mercurial import ui, hg, match, node
84 84 > from time import sleep
85 85 >
86 86 > def replacebyte(fn, b):
87 87 > f = open(fn, "rb+")
88 88 > f.seek(0, 0)
89 89 > f.write(b)
90 90 > f.close()
91 91 >
92 92 > def printfiles(repo, rev):
93 > print("revision %s files: %s" % (rev, repo[rev].files()))
93 > repo.ui.status(b"revision %d files: [%s]\n"
94 > % (rev, b', '.join(b"'%s'" % f
95 > for f in repo[rev].files())))
94 96 >
95 > repo = hg.repository(ui.ui.load(), '.')
97 > repo = hg.repository(ui.ui.load(), b'.')
96 98 > assert len(repo) == 6, \
97 99 > "initial: len(repo): %d, expected: 6" % len(repo)
98 100 >
99 > replacebyte("bugfix", "u")
101 > replacebyte(b"bugfix", b"u")
100 102 > sleep(2)
101 103 > try:
102 > print("PRE: len(repo): %d" % len(repo))
104 > repo.ui.status(b"PRE: len(repo): %d\n" % len(repo))
103 105 > wlock = repo.wlock()
104 106 > lock = repo.lock()
105 > replacebyte("file1", "x")
106 > repo.commit(text="x", user="test", date=(0, 0))
107 > replacebyte("file1", "y")
108 > repo.commit(text="y", user="test", date=(0, 0))
109 > print("POST: len(repo): %d" % len(repo))
107 > replacebyte(b"file1", b"x")
108 > repo.commit(text=b"x", user=b"test", date=(0, 0))
109 > replacebyte(b"file1", b"y")
110 > repo.commit(text=b"y", user=b"test", date=(0, 0))
111 > repo.ui.status(b"POST: len(repo): %d\n" % len(repo))
110 112 > finally:
111 113 > lock.release()
112 114 > wlock.release()
113 115 > printfiles(repo, 6)
114 116 > printfiles(repo, 7)
115 117 > __EOF__
116 118 $ $PYTHON $TESTTMP/committwice.py
117 119 PRE: len(repo): 6
118 120 POST: len(repo): 8
119 121 revision 6 files: ['bugfix', 'file1']
120 122 revision 7 files: ['file1']
121 123
122 124 Do a size-preserving modification outside of that process
123 125 $ echo abcd > bugfix
124 126 $ hg status
125 127 M bugfix
126 128 $ hg log --template "{rev} {desc} {files}\n" -r5:
127 129 5 fix 2 bugfix file1
128 130 6 x bugfix file1
129 131 7 y file1
130 132
131 133 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now