Mercurial > hg
comparison tests/test-fix.t @ 42008:7f6b375a8903
fix: allow fixing untracked files when given as arguments
It's more useful to fix the file than to silently avoid it when the user does
this:
hg fix --working-dir untracked-file
We will still do nothing to ignored files, even if they are specified. This may
be safer, given that such files can unexpectedly slip into the arguments via a
shell glob or fileset.
Differential Revision: https://phab.mercurial-scm.org/D6165
author | Danny Hooper <hooper@google.com> |
---|---|
date | Thu, 21 Mar 2019 18:35:39 -0700 |
parents | d8f5c615e811 |
children | 0da689a60163 |
comparison
equal
deleted
inserted
replaced
42007:b5511845f9d5 | 42008:7f6b375a8903 |
---|---|
352 MODIFIED!!! | 352 MODIFIED!!! |
353 unknown | 353 unknown |
354 | 354 |
355 $ printf "modified!!!\n" > modified.whole | 355 $ printf "modified!!!\n" > modified.whole |
356 $ printf "added\n" > added.whole | 356 $ printf "added\n" > added.whole |
357 | |
358 Listing the files explicitly causes untracked files to also be fixed, but | |
359 ignored files are still unaffected. | |
360 | |
357 $ hg fix --working-dir *.whole | 361 $ hg fix --working-dir *.whole |
358 | 362 |
359 $ hg status --all | 363 $ hg status --all |
360 M clean.whole | 364 M clean.whole |
361 M modified.whole | 365 M modified.whole |
364 ! deleted.whole | 368 ! deleted.whole |
365 ? unknown.whole | 369 ? unknown.whole |
366 I ignored.whole | 370 I ignored.whole |
367 C .hgignore | 371 C .hgignore |
368 | 372 |
369 It would be better if this also fixed the unknown file. | |
370 $ cat *.whole | 373 $ cat *.whole |
371 ADDED | 374 ADDED |
372 CLEAN | 375 CLEAN |
373 ignored | 376 ignored |
374 MODIFIED!!! | 377 MODIFIED!!! |
375 unknown | 378 UNKNOWN |
376 | 379 |
377 $ cd .. | 380 $ cd .. |
378 | 381 |
379 Test that incremental fixing works on files with additions, deletions, and | 382 Test that incremental fixing works on files with additions, deletions, and |
380 changes in multiple line ranges. Note that deletions do not generally cause | 383 changes in multiple line ranges. Note that deletions do not generally cause |