##// END OF EJS Templates
py3: glob out some error messages in test-fileset.t...
Yuya Nishihara -
r38349:62376d7b default
parent child Browse files
Show More
@@ -1,506 +1,507 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-amend.t
7 7 test-ancestor.py
8 8 test-annotate.py
9 9 test-annotate.t
10 10 test-archive-symlinks.t
11 11 test-atomictempfile.py
12 12 test-audit-path.t
13 13 test-audit-subrepo.t
14 14 test-automv.t
15 15 test-backout.t
16 16 test-backwards-remove.t
17 17 test-basic.t
18 18 test-bheads.t
19 19 test-bisect.t
20 20 test-bisect2.t
21 21 test-bisect3.t
22 22 test-blackbox.t
23 23 test-bookmarks-current.t
24 24 test-bookmarks-merge.t
25 25 test-bookmarks-rebase.t
26 26 test-bookmarks-strip.t
27 27 test-bookmarks.t
28 28 test-branch-change.t
29 29 test-branch-option.t
30 30 test-branch-tag-confict.t
31 31 test-branches.t
32 32 test-bundle-phases.t
33 33 test-bundle-type.t
34 34 test-bundle-vs-outgoing.t
35 35 test-bundle2-multiple-changegroups.t
36 36 test-cappedreader.py
37 37 test-casecollision.t
38 38 test-cat.t
39 39 test-cbor.py
40 40 test-censor.t
41 41 test-changelog-exec.t
42 42 test-check-commit.t
43 43 test-check-execute.t
44 44 test-check-interfaces.py
45 45 test-check-module-imports.t
46 46 test-check-pyflakes.t
47 47 test-check-pylint.t
48 48 test-check-shbang.t
49 49 test-children.t
50 50 test-clone-cgi.t
51 51 test-clone-pull-corruption.t
52 52 test-clone-r.t
53 53 test-clone-update-order.t
54 54 test-command-template.t
55 55 test-commit-amend.t
56 56 test-commit-interactive.t
57 57 test-commit-multiple.t
58 58 test-commit-unresolved.t
59 59 test-commit.t
60 60 test-committer.t
61 61 test-completion.t
62 62 test-config-env.py
63 63 test-config.t
64 64 test-conflict.t
65 65 test-confused-revert.t
66 66 test-context.py
67 67 test-contrib-check-code.t
68 68 test-contrib-check-commit.t
69 69 test-convert-authormap.t
70 70 test-convert-clonebranches.t
71 71 test-convert-cvs-branch.t
72 72 test-convert-cvs-detectmerge.t
73 73 test-convert-cvs-synthetic.t
74 74 test-convert-cvs.t
75 75 test-convert-cvsnt-mergepoints.t
76 76 test-convert-datesort.t
77 77 test-convert-filemap.t
78 78 test-convert-hg-sink.t
79 79 test-convert-hg-source.t
80 80 test-convert-hg-startrev.t
81 81 test-convert-splicemap.t
82 82 test-convert-tagsbranch-topology.t
83 83 test-copy-move-merge.t
84 84 test-copy.t
85 85 test-copytrace-heuristics.t
86 86 test-debugbuilddag.t
87 87 test-debugbundle.t
88 88 test-debugextensions.t
89 89 test-debugindexdot.t
90 90 test-debugrename.t
91 91 test-default-push.t
92 92 test-diff-binary-file.t
93 93 test-diff-change.t
94 94 test-diff-copy-depth.t
95 95 test-diff-hashes.t
96 96 test-diff-ignore-whitespace.t
97 97 test-diff-indent-heuristic.t
98 98 test-diff-issue2761.t
99 99 test-diff-newlines.t
100 100 test-diff-reverse.t
101 101 test-diff-subdir.t
102 102 test-diff-unified.t
103 103 test-diff-upgrade.t
104 104 test-diffdir.t
105 105 test-diffstat.t
106 106 test-directaccess.t
107 107 test-dirstate-backup.t
108 108 test-dirstate-nonnormalset.t
109 109 test-dirstate.t
110 110 test-dispatch.py
111 111 test-doctest.py
112 112 test-double-merge.t
113 113 test-drawdag.t
114 114 test-duplicateoptions.py
115 115 test-editor-filename.t
116 116 test-empty-dir.t
117 117 test-empty-file.t
118 118 test-empty-group.t
119 119 test-empty.t
120 120 test-encode.t
121 121 test-encoding-func.py
122 122 test-encoding.t
123 123 test-eol-add.t
124 124 test-eol-clone.t
125 125 test-eol-hook.t
126 126 test-eol-tag.t
127 127 test-eol-update.t
128 128 test-excessive-merge.t
129 129 test-exchange-obsmarkers-case-A1.t
130 130 test-exchange-obsmarkers-case-A2.t
131 131 test-exchange-obsmarkers-case-A3.t
132 132 test-exchange-obsmarkers-case-A4.t
133 133 test-exchange-obsmarkers-case-A5.t
134 134 test-exchange-obsmarkers-case-A6.t
135 135 test-exchange-obsmarkers-case-A7.t
136 136 test-exchange-obsmarkers-case-B1.t
137 137 test-exchange-obsmarkers-case-B2.t
138 138 test-exchange-obsmarkers-case-B3.t
139 139 test-exchange-obsmarkers-case-B4.t
140 140 test-exchange-obsmarkers-case-B5.t
141 141 test-exchange-obsmarkers-case-B6.t
142 142 test-exchange-obsmarkers-case-B7.t
143 143 test-exchange-obsmarkers-case-C1.t
144 144 test-exchange-obsmarkers-case-C2.t
145 145 test-exchange-obsmarkers-case-C3.t
146 146 test-exchange-obsmarkers-case-C4.t
147 147 test-exchange-obsmarkers-case-D1.t
148 148 test-exchange-obsmarkers-case-D2.t
149 149 test-exchange-obsmarkers-case-D3.t
150 150 test-exchange-obsmarkers-case-D4.t
151 151 test-execute-bit.t
152 152 test-export.t
153 153 test-extdata.t
154 154 test-extdiff.t
155 155 test-extensions-afterloaded.t
156 156 test-extensions-wrapfunction.py
157 157 test-extra-filelog-entry.t
158 158 test-filebranch.t
159 159 test-filecache.py
160 160 test-filelog.py
161 161 test-fileset-generated.t
162 test-fileset.t
162 163 test-fix-topology.t
163 164 test-flags.t
164 165 test-generaldelta.t
165 166 test-getbundle.t
166 167 test-git-export.t
167 168 test-glog-topological.t
168 169 test-gpg.t
169 170 test-graft.t
170 171 test-hg-parseurl.py
171 172 test-hghave.t
172 173 test-hgignore.t
173 174 test-hgk.t
174 175 test-hgrc.t
175 176 test-hgweb-bundle.t
176 177 test-hgweb-descend-empties.t
177 178 test-hgweb-empty.t
178 179 test-hgweb-removed.t
179 180 test-hgwebdir-paths.py
180 181 test-hgwebdirsym.t
181 182 test-histedit-arguments.t
182 183 test-histedit-base.t
183 184 test-histedit-bookmark-motion.t
184 185 test-histedit-commute.t
185 186 test-histedit-drop.t
186 187 test-histedit-edit.t
187 188 test-histedit-fold-non-commute.t
188 189 test-histedit-fold.t
189 190 test-histedit-no-change.t
190 191 test-histedit-non-commute-abort.t
191 192 test-histedit-non-commute.t
192 193 test-histedit-obsolete.t
193 194 test-histedit-outgoing.t
194 195 test-histedit-templates.t
195 196 test-http-branchmap.t
196 197 test-http-bundle1.t
197 198 test-http-clone-r.t
198 199 test-http.t
199 200 test-hybridencode.py
200 201 test-identify.t
201 202 test-import-merge.t
202 203 test-import-unknown.t
203 204 test-import.t
204 205 test-imports-checker.t
205 206 test-incoming-outgoing.t
206 207 test-inherit-mode.t
207 208 test-issue1089.t
208 209 test-issue1102.t
209 210 test-issue1175.t
210 211 test-issue1306.t
211 212 test-issue1438.t
212 213 test-issue1502.t
213 214 test-issue1802.t
214 215 test-issue1877.t
215 216 test-issue1993.t
216 217 test-issue2137.t
217 218 test-issue3084.t
218 219 test-issue4074.t
219 220 test-issue522.t
220 221 test-issue586.t
221 222 test-issue612.t
222 223 test-issue619.t
223 224 test-issue660.t
224 225 test-issue672.t
225 226 test-issue842.t
226 227 test-journal-exists.t
227 228 test-journal-share.t
228 229 test-journal.t
229 230 test-largefiles-cache.t
230 231 test-largefiles-misc.t
231 232 test-largefiles-small-disk.t
232 233 test-largefiles-update.t
233 234 test-largefiles.t
234 235 test-lfs-largefiles.t
235 236 test-lfs-pointer.py
236 237 test-linerange.py
237 238 test-locate.t
238 239 test-lock-badness.t
239 240 test-log-linerange.t
240 241 test-log.t
241 242 test-logexchange.t
242 243 test-lrucachedict.py
243 244 test-mactext.t
244 245 test-mailmap.t
245 246 test-manifest-merging.t
246 247 test-manifest.py
247 248 test-manifest.t
248 249 test-match.py
249 250 test-mdiff.py
250 251 test-merge-changedelete.t
251 252 test-merge-closedheads.t
252 253 test-merge-commit.t
253 254 test-merge-criss-cross.t
254 255 test-merge-default.t
255 256 test-merge-force.t
256 257 test-merge-halt.t
257 258 test-merge-internal-tools-pattern.t
258 259 test-merge-local.t
259 260 test-merge-remove.t
260 261 test-merge-revert.t
261 262 test-merge-revert2.t
262 263 test-merge-subrepos.t
263 264 test-merge-symlinks.t
264 265 test-merge-tools.t
265 266 test-merge-types.t
266 267 test-merge1.t
267 268 test-merge10.t
268 269 test-merge2.t
269 270 test-merge4.t
270 271 test-merge5.t
271 272 test-merge6.t
272 273 test-merge7.t
273 274 test-merge8.t
274 275 test-merge9.t
275 276 test-minifileset.py
276 277 test-minirst.py
277 278 test-mq-git.t
278 279 test-mq-header-date.t
279 280 test-mq-header-from.t
280 281 test-mq-merge.t
281 282 test-mq-pull-from-bundle.t
282 283 test-mq-qclone-http.t
283 284 test-mq-qdelete.t
284 285 test-mq-qdiff.t
285 286 test-mq-qfold.t
286 287 test-mq-qgoto.t
287 288 test-mq-qimport-fail-cleanup.t
288 289 test-mq-qnew.t
289 290 test-mq-qpush-exact.t
290 291 test-mq-qqueue.t
291 292 test-mq-qrefresh-interactive.t
292 293 test-mq-qrefresh-replace-log-message.t
293 294 test-mq-qrefresh.t
294 295 test-mq-qrename.t
295 296 test-mq-qsave.t
296 297 test-mq-safety.t
297 298 test-mq-subrepo.t
298 299 test-mq-symlinks.t
299 300 test-mv-cp-st-diff.t
300 301 test-narrow-archive.t
301 302 test-narrow-clone-no-ellipsis.t
302 303 test-narrow-clone-non-narrow-server.t
303 304 test-narrow-clone-nonlinear.t
304 305 test-narrow-clone.t
305 306 test-narrow-commit.t
306 307 test-narrow-copies.t
307 308 test-narrow-debugcommands.t
308 309 test-narrow-debugrebuilddirstate.t
309 310 test-narrow-exchange-merges.t
310 311 test-narrow-exchange.t
311 312 test-narrow-expanddirstate.t
312 313 test-narrow-merge.t
313 314 test-narrow-patch.t
314 315 test-narrow-patterns.t
315 316 test-narrow-pull.t
316 317 test-narrow-rebase.t
317 318 test-narrow-shallow-merges.t
318 319 test-narrow-shallow.t
319 320 test-narrow-strip.t
320 321 test-narrow-update.t
321 322 test-nested-repo.t
322 323 test-newbranch.t
323 324 test-obshistory.t
324 325 test-obsmarker-template.t
325 326 test-obsmarkers-effectflag.t
326 327 test-obsolete-bundle-strip.t
327 328 test-obsolete-changeset-exchange.t
328 329 test-obsolete-checkheads.t
329 330 test-obsolete-distributed.t
330 331 test-obsolete-tag-cache.t
331 332 test-pager.t
332 333 test-parents.t
333 334 test-parseindex2.py
334 335 test-pathconflicts-merge.t
335 336 test-pathconflicts-update.t
336 337 test-pathencode.py
337 338 test-pending.t
338 339 test-permissions.t
339 340 test-phases.t
340 341 test-pull-branch.t
341 342 test-pull-http.t
342 343 test-pull-permission.t
343 344 test-pull-pull-corruption.t
344 345 test-pull-r.t
345 346 test-pull-update.t
346 347 test-pull.t
347 348 test-purge.t
348 349 test-push-checkheads-partial-C1.t
349 350 test-push-checkheads-partial-C2.t
350 351 test-push-checkheads-partial-C3.t
351 352 test-push-checkheads-partial-C4.t
352 353 test-push-checkheads-pruned-B1.t
353 354 test-push-checkheads-pruned-B2.t
354 355 test-push-checkheads-pruned-B3.t
355 356 test-push-checkheads-pruned-B4.t
356 357 test-push-checkheads-pruned-B5.t
357 358 test-push-checkheads-pruned-B6.t
358 359 test-push-checkheads-pruned-B7.t
359 360 test-push-checkheads-pruned-B8.t
360 361 test-push-checkheads-superceed-A1.t
361 362 test-push-checkheads-superceed-A2.t
362 363 test-push-checkheads-superceed-A3.t
363 364 test-push-checkheads-superceed-A4.t
364 365 test-push-checkheads-superceed-A5.t
365 366 test-push-checkheads-superceed-A6.t
366 367 test-push-checkheads-superceed-A7.t
367 368 test-push-checkheads-superceed-A8.t
368 369 test-push-checkheads-unpushed-D1.t
369 370 test-push-checkheads-unpushed-D2.t
370 371 test-push-checkheads-unpushed-D3.t
371 372 test-push-checkheads-unpushed-D4.t
372 373 test-push-checkheads-unpushed-D5.t
373 374 test-push-checkheads-unpushed-D6.t
374 375 test-push-checkheads-unpushed-D7.t
375 376 test-push-http.t
376 377 test-push-warn.t
377 378 test-push.t
378 379 test-pushvars.t
379 380 test-rebase-abort.t
380 381 test-rebase-base-flag.t
381 382 test-rebase-bookmarks.t
382 383 test-rebase-brute-force.t
383 384 test-rebase-cache.t
384 385 test-rebase-check-restore.t
385 386 test-rebase-collapse.t
386 387 test-rebase-conflicts.t
387 388 test-rebase-dest.t
388 389 test-rebase-detach.t
389 390 test-rebase-emptycommit.t
390 391 test-rebase-inmemory.t
391 392 test-rebase-interruptions.t
392 393 test-rebase-issue-noparam-single-rev.t
393 394 test-rebase-legacy.t
394 395 test-rebase-mq-skip.t
395 396 test-rebase-mq.t
396 397 test-rebase-named-branches.t
397 398 test-rebase-newancestor.t
398 399 test-rebase-obsolete.t
399 400 test-rebase-parameters.t
400 401 test-rebase-partial.t
401 402 test-rebase-pull.t
402 403 test-rebase-rename.t
403 404 test-rebase-scenario-global.t
404 405 test-rebase-templates.t
405 406 test-rebase-transaction.t
406 407 test-rebuildstate.t
407 408 test-record.t
408 409 test-relink.t
409 410 test-remove.t
410 411 test-rename-after-merge.t
411 412 test-rename-dir-merge.t
412 413 test-rename-merge1.t
413 414 test-rename.t
414 415 test-repair-strip.t
415 416 test-repo-compengines.t
416 417 test-resolve.t
417 418 test-revert-flags.t
418 419 test-revert-interactive.t
419 420 test-revert-unknown.t
420 421 test-revlog-ancestry.py
421 422 test-revlog-group-emptyiter.t
422 423 test-revlog-mmapindex.t
423 424 test-revlog-packentry.t
424 425 test-revlog-raw.py
425 426 test-revset-dirstate-parents.t
426 427 test-revset-legacy-lookup.t
427 428 test-revset-outgoing.t
428 429 test-rollback.t
429 430 test-run-tests.py
430 431 test-run-tests.t
431 432 test-schemes.t
432 433 test-serve.t
433 434 test-setdiscovery.t
434 435 test-share.t
435 436 test-shelve.t
436 437 test-show-stack.t
437 438 test-show-work.t
438 439 test-show.t
439 440 test-simple-update.t
440 441 test-simplekeyvaluefile.py
441 442 test-simplemerge.py
442 443 test-single-head.t
443 444 test-sparse-clear.t
444 445 test-sparse-clone.t
445 446 test-sparse-import.t
446 447 test-sparse-merges.t
447 448 test-sparse-profiles.t
448 449 test-sparse-requirement.t
449 450 test-sparse-verbose-json.t
450 451 test-sparse.t
451 452 test-split.t
452 453 test-ssh-clone-r.t
453 454 test-ssh-proto-unbundle.t
454 455 test-ssh-proto.t
455 456 test-sshserver.py
456 457 test-stack.t
457 458 test-status-inprocess.py
458 459 test-status-rev.t
459 460 test-status-terse.t
460 461 test-strict.t
461 462 test-strip-cross.t
462 463 test-strip.t
463 464 test-subrepo-deep-nested-change.t
464 465 test-subrepo-missing.t
465 466 test-subrepo-paths.t
466 467 test-subrepo-recursion.t
467 468 test-subrepo-relative-path.t
468 469 test-subrepo.t
469 470 test-symlink-os-yes-fs-no.py
470 471 test-symlink-placeholder.t
471 472 test-symlinks.t
472 473 test-tag.t
473 474 test-tags.t
474 475 test-template-engine.t
475 476 test-template-filters.t
476 477 test-treemanifest.t
477 478 test-ui-color.py
478 479 test-ui-config.py
479 480 test-ui-verbosity.py
480 481 test-unamend.t
481 482 test-uncommit.t
482 483 test-unified-test.t
483 484 test-unionrepo.t
484 485 test-unrelated-pull.t
485 486 test-up-local-change.t
486 487 test-update-branches.t
487 488 test-update-dest.t
488 489 test-update-issue1456.t
489 490 test-update-names.t
490 491 test-update-reverse.t
491 492 test-upgrade-repo.t
492 493 test-url-download.t
493 494 test-url-rev.t
494 495 test-url.py
495 496 test-username-newline.t
496 497 test-verify.t
497 498 test-walk.t
498 499 test-walkrepo.py
499 500 test-websub.t
500 501 test-win32text.t
501 502 test-wireproto-clientreactor.py
502 503 test-wireproto-framing.py
503 504 test-wireproto-serverreactor.py
504 505 test-wireproto.py
505 506 test-wsgirequest.py
506 507 test-xdg.t
@@ -1,676 +1,676 b''
1 1 $ fileset() {
2 2 > hg debugfileset "$@"
3 3 > }
4 4
5 5 $ hg init repo
6 6 $ cd repo
7 7 $ echo a > a1
8 8 $ echo a > a2
9 9 $ echo b > b1
10 10 $ echo b > b2
11 11 $ hg ci -Am addfiles
12 12 adding a1
13 13 adding a2
14 14 adding b1
15 15 adding b2
16 16
17 17 Test operators and basic patterns
18 18
19 19 $ fileset -v a1
20 20 (symbol 'a1')
21 21 a1
22 22 $ fileset -v 'a*'
23 23 (symbol 'a*')
24 24 a1
25 25 a2
26 26 $ fileset -v '"re:a\d"'
27 27 (string 're:a\\d')
28 28 a1
29 29 a2
30 30 $ fileset -v '!re:"a\d"'
31 31 (not
32 32 (kindpat
33 33 (symbol 're')
34 34 (string 'a\\d')))
35 35 b1
36 36 b2
37 37 $ fileset -v 'path:a1 or glob:b?'
38 38 (or
39 39 (kindpat
40 40 (symbol 'path')
41 41 (symbol 'a1'))
42 42 (kindpat
43 43 (symbol 'glob')
44 44 (symbol 'b?')))
45 45 a1
46 46 b1
47 47 b2
48 48 $ fileset -v 'a1 or a2'
49 49 (or
50 50 (symbol 'a1')
51 51 (symbol 'a2'))
52 52 a1
53 53 a2
54 54 $ fileset 'a1 | a2'
55 55 a1
56 56 a2
57 57 $ fileset 'a* and "*1"'
58 58 a1
59 59 $ fileset 'a* & "*1"'
60 60 a1
61 61 $ fileset 'not (r"a*")'
62 62 b1
63 63 b2
64 64 $ fileset '! ("a*")'
65 65 b1
66 66 b2
67 67 $ fileset 'a* - a1'
68 68 a2
69 69 $ fileset 'a_b'
70 70 $ fileset '"\xy"'
71 hg: parse error: invalid \x escape
71 hg: parse error: invalid \x escape* (glob)
72 72 [255]
73 73
74 74 Test invalid syntax
75 75
76 76 $ fileset -v '"added"()'
77 77 (func
78 78 (string 'added')
79 79 None)
80 80 hg: parse error: not a symbol
81 81 [255]
82 82 $ fileset -v '()()'
83 83 (func
84 84 (group
85 85 None)
86 86 None)
87 87 hg: parse error: not a symbol
88 88 [255]
89 89 $ fileset -v -- '-x'
90 90 (negate
91 91 (symbol 'x'))
92 92 hg: parse error: can't use negate operator in this context
93 93 [255]
94 94 $ fileset -v -- '-()'
95 95 (negate
96 96 (group
97 97 None))
98 98 hg: parse error: can't use negate operator in this context
99 99 [255]
100 100
101 101 $ fileset '"path":.'
102 102 hg: parse error: not a symbol
103 103 [255]
104 104 $ fileset 'path:foo bar'
105 105 hg: parse error at 9: invalid token
106 106 [255]
107 107 $ fileset 'foo:bar:baz'
108 108 hg: parse error: not a symbol
109 109 [255]
110 110 $ fileset 'foo:bar()'
111 111 hg: parse error: pattern must be a string
112 112 [255]
113 113 $ fileset 'foo:bar'
114 114 hg: parse error: invalid pattern kind: foo
115 115 [255]
116 116
117 117 Test files status
118 118
119 119 $ rm a1
120 120 $ hg rm a2
121 121 $ echo b >> b2
122 122 $ hg cp b1 c1
123 123 $ echo c > c2
124 124 $ echo c > c3
125 125 $ cat > .hgignore <<EOF
126 126 > \.hgignore
127 127 > 2$
128 128 > EOF
129 129 $ fileset 'modified()'
130 130 b2
131 131 $ fileset 'added()'
132 132 c1
133 133 $ fileset 'removed()'
134 134 a2
135 135 $ fileset 'deleted()'
136 136 a1
137 137 $ fileset 'missing()'
138 138 a1
139 139 $ fileset 'unknown()'
140 140 c3
141 141 $ fileset 'ignored()'
142 142 .hgignore
143 143 c2
144 144 $ fileset 'hgignore()'
145 145 a2
146 146 b2
147 147 $ fileset 'clean()'
148 148 b1
149 149 $ fileset 'copied()'
150 150 c1
151 151
152 152 Test files status in different revisions
153 153
154 154 $ hg status -m
155 155 M b2
156 156 $ fileset -r0 'revs("wdir()", modified())' --traceback
157 157 b2
158 158 $ hg status -a
159 159 A c1
160 160 $ fileset -r0 'revs("wdir()", added())'
161 161 c1
162 162 $ hg status --change 0 -a
163 163 A a1
164 164 A a2
165 165 A b1
166 166 A b2
167 167 $ hg status -mru
168 168 M b2
169 169 R a2
170 170 ? c3
171 171 $ fileset -r0 'added() and revs("wdir()", modified() or removed() or unknown())'
172 172 b2
173 173 a2
174 174 $ fileset -r0 'added() or revs("wdir()", added())'
175 175 a1
176 176 a2
177 177 b1
178 178 b2
179 179 c1
180 180
181 181 Test files properties
182 182
183 183 >>> open('bin', 'wb').write(b'\0a') and None
184 184 $ fileset 'binary()'
185 185 $ fileset 'binary() and unknown()'
186 186 bin
187 187 $ echo '^bin$' >> .hgignore
188 188 $ fileset 'binary() and ignored()'
189 189 bin
190 190 $ hg add bin
191 191 $ fileset 'binary()'
192 192 bin
193 193
194 194 $ fileset 'grep("b{1}")'
195 195 b2
196 196 c1
197 197 b1
198 198 $ fileset 'grep("missingparens(")'
199 hg: parse error: invalid match pattern: unbalanced parenthesis
199 hg: parse error: invalid match pattern: (unbalanced parenthesis|missing \)).* (re)
200 200 [255]
201 201
202 202 #if execbit
203 203 $ chmod +x b2
204 204 $ fileset 'exec()'
205 205 b2
206 206 #endif
207 207
208 208 #if symlink
209 209 $ ln -s b2 b2link
210 210 $ fileset 'symlink() and unknown()'
211 211 b2link
212 212 $ hg add b2link
213 213 #endif
214 214
215 215 #if no-windows
216 216 $ echo foo > con.xml
217 217 $ fileset 'not portable()'
218 218 con.xml
219 219 $ hg --config ui.portablefilenames=ignore add con.xml
220 220 #endif
221 221
222 222 >>> open('1k', 'wb').write(b' '*1024) and None
223 223 >>> open('2k', 'wb').write(b' '*2048) and None
224 224 $ hg add 1k 2k
225 225 $ fileset 'size("bar")'
226 226 hg: parse error: couldn't parse size: bar
227 227 [255]
228 228 $ fileset '(1k, 2k)'
229 229 hg: parse error: can't use a list in this context
230 230 (see hg help "filesets.x or y")
231 231 [255]
232 232 $ fileset 'size(1k)'
233 233 1k
234 234 $ fileset '(1k or 2k) and size("< 2k")'
235 235 1k
236 236 $ fileset '(1k or 2k) and size("<=2k")'
237 237 1k
238 238 2k
239 239 $ fileset '(1k or 2k) and size("> 1k")'
240 240 2k
241 241 $ fileset '(1k or 2k) and size(">=1K")'
242 242 1k
243 243 2k
244 244 $ fileset '(1k or 2k) and size(".5KB - 1.5kB")'
245 245 1k
246 246 $ fileset 'size("1M")'
247 247 $ fileset 'size("1 GB")'
248 248
249 249 Test merge states
250 250
251 251 $ hg ci -m manychanges
252 252 $ hg file -r . 'set:copied() & modified()'
253 253 [1]
254 254 $ hg up -C 0
255 255 * files updated, 0 files merged, * files removed, 0 files unresolved (glob)
256 256 $ echo c >> b2
257 257 $ hg ci -m diverging b2
258 258 created new head
259 259 $ fileset 'resolved()'
260 260 $ fileset 'unresolved()'
261 261 $ hg merge
262 262 merging b2
263 263 warning: conflicts while merging b2! (edit, then use 'hg resolve --mark')
264 264 * files updated, 0 files merged, 1 files removed, 1 files unresolved (glob)
265 265 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
266 266 [1]
267 267 $ fileset 'resolved()'
268 268 $ fileset 'unresolved()'
269 269 b2
270 270 $ echo e > b2
271 271 $ hg resolve -m b2
272 272 (no more unresolved files)
273 273 $ fileset 'resolved()'
274 274 b2
275 275 $ fileset 'unresolved()'
276 276 $ hg ci -m merge
277 277
278 278 Test subrepo predicate
279 279
280 280 $ hg init sub
281 281 $ echo a > sub/suba
282 282 $ hg -R sub add sub/suba
283 283 $ hg -R sub ci -m sub
284 284 $ echo 'sub = sub' > .hgsub
285 285 $ hg init sub2
286 286 $ echo b > sub2/b
287 287 $ hg -R sub2 ci -Am sub2
288 288 adding b
289 289 $ echo 'sub2 = sub2' >> .hgsub
290 290 $ fileset 'subrepo()'
291 291 $ hg add .hgsub
292 292 $ fileset 'subrepo()'
293 293 sub
294 294 sub2
295 295 $ fileset 'subrepo("sub")'
296 296 sub
297 297 $ fileset 'subrepo("glob:*")'
298 298 sub
299 299 sub2
300 300 $ hg ci -m subrepo
301 301
302 302 Test that .hgsubstate is updated as appropriate during a conversion. The
303 303 saverev property is enough to alter the hashes of the subrepo.
304 304
305 305 $ hg init ../converted
306 306 $ hg --config extensions.convert= convert --config convert.hg.saverev=True \
307 307 > sub ../converted/sub
308 308 initializing destination ../converted/sub repository
309 309 scanning source...
310 310 sorting...
311 311 converting...
312 312 0 sub
313 313 $ hg clone -U sub2 ../converted/sub2
314 314 $ hg --config extensions.convert= convert --config convert.hg.saverev=True \
315 315 > . ../converted
316 316 scanning source...
317 317 sorting...
318 318 converting...
319 319 4 addfiles
320 320 3 manychanges
321 321 2 diverging
322 322 1 merge
323 323 0 subrepo
324 324 no ".hgsubstate" updates will be made for "sub2"
325 325 $ hg up -q -R ../converted -r tip
326 326 $ hg --cwd ../converted cat sub/suba sub2/b -r tip
327 327 a
328 328 b
329 329 $ oldnode=`hg log -r tip -T "{node}\n"`
330 330 $ newnode=`hg log -R ../converted -r tip -T "{node}\n"`
331 331 $ [ "$oldnode" != "$newnode" ] || echo "nothing changed"
332 332
333 333 Test with a revision
334 334
335 335 $ hg log -G --template '{rev} {desc}\n'
336 336 @ 4 subrepo
337 337 |
338 338 o 3 merge
339 339 |\
340 340 | o 2 diverging
341 341 | |
342 342 o | 1 manychanges
343 343 |/
344 344 o 0 addfiles
345 345
346 346 $ echo unknown > unknown
347 347 $ fileset -r1 'modified()'
348 348 b2
349 349 $ fileset -r1 'added() and c1'
350 350 c1
351 351 $ fileset -r1 'removed()'
352 352 a2
353 353 $ fileset -r1 'deleted()'
354 354 $ fileset -r1 'unknown()'
355 355 $ fileset -r1 'ignored()'
356 356 $ fileset -r1 'hgignore()'
357 357 b2
358 358 bin
359 359 $ fileset -r1 'binary()'
360 360 bin
361 361 $ fileset -r1 'size(1k)'
362 362 1k
363 363 $ fileset -r3 'resolved()'
364 364 $ fileset -r3 'unresolved()'
365 365
366 366 #if execbit
367 367 $ fileset -r1 'exec()'
368 368 b2
369 369 #endif
370 370
371 371 #if symlink
372 372 $ fileset -r1 'symlink()'
373 373 b2link
374 374 #endif
375 375
376 376 #if no-windows
377 377 $ fileset -r1 'not portable()'
378 378 con.xml
379 379 $ hg forget 'con.xml'
380 380 #endif
381 381
382 382 $ fileset -r4 'subrepo("re:su.*")'
383 383 sub
384 384 sub2
385 385 $ fileset -r4 'subrepo(re:su.*)'
386 386 sub
387 387 sub2
388 388 $ fileset -r4 'subrepo("sub")'
389 389 sub
390 390 $ fileset -r4 'b2 or c1'
391 391 b2
392 392 c1
393 393
394 394 >>> open('dos', 'wb').write(b"dos\r\n") and None
395 395 >>> open('mixed', 'wb').write(b"dos\r\nunix\n") and None
396 396 >>> open('mac', 'wb').write(b"mac\r") and None
397 397 $ hg add dos mixed mac
398 398
399 399 (remove a1, to examine safety of 'eol' on removed files)
400 400 $ rm a1
401 401
402 402 $ fileset 'eol(dos)'
403 403 dos
404 404 mixed
405 405 $ fileset 'eol(unix)'
406 406 mixed
407 407 .hgsub
408 408 .hgsubstate
409 409 b1
410 410 b2
411 411 c1
412 412 $ fileset 'eol(mac)'
413 413 mac
414 414
415 415 Test safety of 'encoding' on removed files
416 416
417 417 $ fileset 'encoding("ascii")'
418 418 dos
419 419 mac
420 420 mixed
421 421 .hgsub
422 422 .hgsubstate
423 423 1k
424 424 2k
425 425 b1
426 426 b2
427 427 b2link (symlink !)
428 428 bin
429 429 c1
430 430
431 431 Test detection of unintentional 'matchctx.existing()' invocation
432 432
433 433 $ cat > $TESTTMP/existingcaller.py <<EOF
434 434 > from mercurial import registrar
435 435 >
436 436 > filesetpredicate = registrar.filesetpredicate()
437 437 > @filesetpredicate(b'existingcaller()', callexisting=False)
438 438 > def existingcaller(mctx, x):
439 439 > # this 'mctx.existing()' invocation is unintentional
440 440 > return [f for f in mctx.existing()]
441 441 > EOF
442 442
443 443 $ cat >> .hg/hgrc <<EOF
444 444 > [extensions]
445 445 > existingcaller = $TESTTMP/existingcaller.py
446 446 > EOF
447 447
448 448 $ fileset 'existingcaller()' 2>&1 | tail -1
449 449 *ProgrammingError: *unexpected existing() invocation* (glob)
450 450
451 451 Test 'revs(...)'
452 452 ================
453 453
454 454 small reminder of the repository state
455 455
456 456 $ hg log -G
457 457 @ changeset: 4:* (glob)
458 458 | tag: tip
459 459 | user: test
460 460 | date: Thu Jan 01 00:00:00 1970 +0000
461 461 | summary: subrepo
462 462 |
463 463 o changeset: 3:* (glob)
464 464 |\ parent: 2:55b05bdebf36
465 465 | | parent: 1:* (glob)
466 466 | | user: test
467 467 | | date: Thu Jan 01 00:00:00 1970 +0000
468 468 | | summary: merge
469 469 | |
470 470 | o changeset: 2:55b05bdebf36
471 471 | | parent: 0:8a9576c51c1f
472 472 | | user: test
473 473 | | date: Thu Jan 01 00:00:00 1970 +0000
474 474 | | summary: diverging
475 475 | |
476 476 o | changeset: 1:* (glob)
477 477 |/ user: test
478 478 | date: Thu Jan 01 00:00:00 1970 +0000
479 479 | summary: manychanges
480 480 |
481 481 o changeset: 0:8a9576c51c1f
482 482 user: test
483 483 date: Thu Jan 01 00:00:00 1970 +0000
484 484 summary: addfiles
485 485
486 486 $ hg status --change 0
487 487 A a1
488 488 A a2
489 489 A b1
490 490 A b2
491 491 $ hg status --change 1
492 492 M b2
493 493 A 1k
494 494 A 2k
495 495 A b2link (no-windows !)
496 496 A bin
497 497 A c1
498 498 A con.xml (no-windows !)
499 499 R a2
500 500 $ hg status --change 2
501 501 M b2
502 502 $ hg status --change 3
503 503 M b2
504 504 A 1k
505 505 A 2k
506 506 A b2link (no-windows !)
507 507 A bin
508 508 A c1
509 509 A con.xml (no-windows !)
510 510 R a2
511 511 $ hg status --change 4
512 512 A .hgsub
513 513 A .hgsubstate
514 514 $ hg status
515 515 A dos
516 516 A mac
517 517 A mixed
518 518 R con.xml (no-windows !)
519 519 ! a1
520 520 ? b2.orig
521 521 ? c3
522 522 ? unknown
523 523
524 524 Test files at -r0 should be filtered by files at wdir
525 525 -----------------------------------------------------
526 526
527 527 $ fileset -r0 '* and revs("wdir()", *)'
528 528 a1
529 529 b1
530 530 b2
531 531
532 532 Test that "revs()" work at all
533 533 ------------------------------
534 534
535 535 $ fileset "revs('2', modified())"
536 536 b2
537 537
538 538 Test that "revs()" work for file missing in the working copy/current context
539 539 ----------------------------------------------------------------------------
540 540
541 541 (a2 not in working copy)
542 542
543 543 $ fileset "revs('0', added())"
544 544 a1
545 545 a2
546 546 b1
547 547 b2
548 548
549 549 (none of the file exist in "0")
550 550
551 551 $ fileset -r 0 "revs('4', added())"
552 552 .hgsub
553 553 .hgsubstate
554 554
555 555 Call with empty revset
556 556 --------------------------
557 557
558 558 $ fileset "revs('2-2', modified())"
559 559
560 560 Call with revset matching multiple revs
561 561 ---------------------------------------
562 562
563 563 $ fileset "revs('0+4', added())"
564 564 a1
565 565 a2
566 566 b1
567 567 b2
568 568 .hgsub
569 569 .hgsubstate
570 570
571 571 overlapping set
572 572
573 573 $ fileset "revs('1+2', modified())"
574 574 b2
575 575
576 576 test 'status(...)'
577 577 =================
578 578
579 579 Simple case
580 580 -----------
581 581
582 582 $ fileset "status(3, 4, added())"
583 583 .hgsub
584 584 .hgsubstate
585 585
586 586 use rev to restrict matched file
587 587 -----------------------------------------
588 588
589 589 $ hg status --removed --rev 0 --rev 1
590 590 R a2
591 591 $ fileset "status(0, 1, removed())"
592 592 a2
593 593 $ fileset "* and status(0, 1, removed())"
594 594 $ fileset -r 4 "status(0, 1, removed())"
595 595 a2
596 596 $ fileset -r 4 "* and status(0, 1, removed())"
597 597 $ fileset "revs('4', * and status(0, 1, removed()))"
598 598 $ fileset "revs('0', * and status(0, 1, removed()))"
599 599 a2
600 600
601 601 check wdir()
602 602 ------------
603 603
604 604 $ hg status --removed --rev 4
605 605 R con.xml (no-windows !)
606 606 $ fileset "status(4, 'wdir()', removed())"
607 607 con.xml (no-windows !)
608 608
609 609 $ hg status --removed --rev 2
610 610 R a2
611 611 $ fileset "status('2', 'wdir()', removed())"
612 612 a2
613 613
614 614 test backward status
615 615 --------------------
616 616
617 617 $ hg status --removed --rev 0 --rev 4
618 618 R a2
619 619 $ hg status --added --rev 4 --rev 0
620 620 A a2
621 621 $ fileset "status(4, 0, added())"
622 622 a2
623 623
624 624 test cross branch status
625 625 ------------------------
626 626
627 627 $ hg status --added --rev 1 --rev 2
628 628 A a2
629 629 $ fileset "status(1, 2, added())"
630 630 a2
631 631
632 632 test with multi revs revset
633 633 ---------------------------
634 634 $ hg status --added --rev 0:1 --rev 3:4
635 635 A .hgsub
636 636 A .hgsubstate
637 637 A 1k
638 638 A 2k
639 639 A b2link (no-windows !)
640 640 A bin
641 641 A c1
642 642 A con.xml (no-windows !)
643 643 $ fileset "status('0:1', '3:4', added())"
644 644 .hgsub
645 645 .hgsubstate
646 646 1k
647 647 2k
648 648 b2link (no-windows !)
649 649 bin
650 650 c1
651 651 con.xml (no-windows !)
652 652
653 653 tests with empty value
654 654 ----------------------
655 655
656 656 Fully empty revset
657 657
658 658 $ fileset "status('', '4', added())"
659 659 hg: parse error: first argument to status must be a revision
660 660 [255]
661 661 $ fileset "status('2', '', added())"
662 662 hg: parse error: second argument to status must be a revision
663 663 [255]
664 664
665 665 Empty revset will error at the revset layer
666 666
667 667 $ fileset "status(' ', '4', added())"
668 668 hg: parse error at 1: not a prefix: end
669 669 (
670 670 ^ here)
671 671 [255]
672 672 $ fileset "status('2', ' ', added())"
673 673 hg: parse error at 1: not a prefix: end
674 674 (
675 675 ^ here)
676 676 [255]
General Comments 0
You need to be logged in to leave comments. Login now