Show More
@@ -2493,8 +2493,8 b' def status(ui, repo, *pats, **opts):' | |||
|
2493 | 2493 | -i (ignored), -C (copies) or -A is given. Unless options described |
|
2494 | 2494 | with "show only ..." are given, the options -mardu are used. |
|
2495 | 2495 | |
|
2496 |
Option -q/--quiet hides untracked |
|
|
2497 | requested by -u. | |
|
2496 | Option -q/--quiet hides untracked (unknown and ignored) files | |
|
2497 | unless explicitly requested with -u/--unknown or -i/-ignored. | |
|
2498 | 2498 | |
|
2499 | 2499 | NOTE: status may appear to disagree with diff if permissions have |
|
2500 | 2500 | changed or a merge has occurred. The standard diff format does not |
@@ -2523,8 +2523,16 b' def status(ui, repo, *pats, **opts):' | |||
|
2523 | 2523 | modified, added, removed, deleted, unknown, ignored, clean = [ |
|
2524 | 2524 | n for n in repo.status(node1=node1, node2=node2, files=files, |
|
2525 | 2525 | match=matchfn, |
|
2526 |
list_ignored= |
|
|
2527 | list_clean=all or opts['clean'])] | |
|
2526 | list_ignored=opts['ignored'] | |
|
2527 | or all and not ui.quiet, | |
|
2528 | list_clean=opts['clean'] or all, | |
|
2529 | list_unknown=opts['unknown'] | |
|
2530 | or not (ui.quiet or | |
|
2531 | opts['modified'] or | |
|
2532 | opts['added'] or | |
|
2533 | opts['removed'] or | |
|
2534 | opts['deleted'] or | |
|
2535 | opts['ignored']))] | |
|
2528 | 2536 | |
|
2529 | 2537 | changetypes = (('modified', 'M', modified), |
|
2530 | 2538 | ('added', 'A', added), |
@@ -2541,11 +2549,6 b' def status(ui, repo, *pats, **opts):' | |||
|
2541 | 2549 | if all or opts[ct[0]]] |
|
2542 | 2550 | or changetypes): |
|
2543 | 2551 | |
|
2544 | # skip unknown files if -q, but -u and -A have priority over -q | |
|
2545 | if (not opts['unknown']) and (not opts['all']): | |
|
2546 | if opt == 'unknown' and ui.quiet: | |
|
2547 | continue | |
|
2548 | ||
|
2549 | 2552 | if opts['no_status']: |
|
2550 | 2553 | format = "%%s%s" % end |
|
2551 | 2554 | else: |
@@ -383,8 +383,8 b' class dirstate(object):' | |||
|
383 | 383 | for src, f, st in self.statwalk(files, match, badmatch=badmatch): |
|
384 | 384 | yield src, f |
|
385 | 385 | |
|
386 |
def statwalk(self, files=None, match=util.always, |
|
|
387 | badmatch=None, directories=False): | |
|
386 | def statwalk(self, files=None, match=util.always, unknown=True, | |
|
387 | ignored=False, badmatch=None, directories=False): | |
|
388 | 388 | ''' |
|
389 | 389 | walk recursively through the directory tree, finding all files |
|
390 | 390 | matched by the match function |
@@ -412,6 +412,7 b' class dirstate(object):' | |||
|
412 | 412 | return False |
|
413 | 413 | return match(file_) |
|
414 | 414 | |
|
415 | # TODO: don't walk unknown directories if unknown and ignored are False | |
|
415 | 416 | ignore = self._ignore |
|
416 | 417 | dirignore = self._dirignore |
|
417 | 418 | if ignored: |
@@ -527,7 +528,7 b' class dirstate(object):' | |||
|
527 | 528 | if imatch(k): |
|
528 | 529 | yield 'm', k, None |
|
529 | 530 | |
|
530 | def status(self, files, match, list_ignored, list_clean): | |
|
531 | def status(self, files, match, list_ignored, list_clean, list_unknown=True): | |
|
531 | 532 | lookup, modified, added, unknown, ignored = [], [], [], [], [] |
|
532 | 533 | removed, deleted, clean = [], [], [] |
|
533 | 534 | |
@@ -545,14 +546,15 b' class dirstate(object):' | |||
|
545 | 546 | dadd = deleted.append |
|
546 | 547 | cadd = clean.append |
|
547 | 548 | |
|
548 |
for src, fn, st in self.statwalk(files, match, |
|
|
549 | for src, fn, st in self.statwalk(files, match, unknown=list_unknown, | |
|
550 | ignored=list_ignored): | |
|
549 | 551 | if fn in dmap: |
|
550 | 552 | type_, mode, size, time, foo = dmap[fn] |
|
551 | 553 | else: |
|
552 | 554 | if (list_ignored or fn in files) and self._dirignore(fn): |
|
553 | 555 | if list_ignored: |
|
554 | 556 | iadd(fn) |
|
555 |
el |
|
|
557 | elif list_unknown: | |
|
556 | 558 | uadd(fn) |
|
557 | 559 | continue |
|
558 | 560 | if src == 'm': |
@@ -959,7 +959,7 b' class localrepository(repo.repository):' | |||
|
959 | 959 | yield src, fn |
|
960 | 960 | |
|
961 | 961 | def status(self, node1=None, node2=None, files=[], match=util.always, |
|
962 | list_ignored=False, list_clean=False): | |
|
962 | list_ignored=False, list_clean=False, list_unknown=True): | |
|
963 | 963 | """return status of files between two nodes or node and working directory |
|
964 | 964 | |
|
965 | 965 | If node1 is None, use the first dirstate parent instead. |
@@ -995,7 +995,8 b' class localrepository(repo.repository):' | |||
|
995 | 995 | if not node2: |
|
996 | 996 | (lookup, modified, added, removed, deleted, unknown, |
|
997 | 997 | ignored, clean) = self.dirstate.status(files, match, |
|
998 |
list_ignored, list_clean |
|
|
998 | list_ignored, list_clean, | |
|
999 | list_unknown) | |
|
999 | 1000 | |
|
1000 | 1001 | # are we comparing working dir against its parent? |
|
1001 | 1002 | if compareworking: |
@@ -222,8 +222,8 b' show changed files in the working direct' | |||
|
222 | 222 | -i (ignored), -C (copies) or -A is given. Unless options described |
|
223 | 223 | with "show only ..." are given, the options -mardu are used. |
|
224 | 224 | |
|
225 |
Option -q/--quiet hides untracked |
|
|
226 | requested by -u. | |
|
225 | Option -q/--quiet hides untracked (unknown and ignored) files | |
|
226 | unless explicitly requested with -u/--unknown or -i/-ignored. | |
|
227 | 227 | |
|
228 | 228 | NOTE: status may appear to disagree with diff if permissions have |
|
229 | 229 | changed or a merge has occurred. The standard diff format does not |
@@ -83,10 +83,11 b' function assert {' | |||
|
83 | 83 | |
|
84 | 84 | # assert flag1 flag2 [0-same | 1-different] |
|
85 | 85 | assert "-q" "-mard" 0 |
|
86 |
assert "-A" "-mardicC |
|
|
87 |
assert "-qA" "-mard |
|
|
88 | assert "-qAu" "-A" 0 | |
|
89 |
assert "-qA |
|
|
86 | assert "-A" "-marduicC" 0 | |
|
87 | assert "-qA" "-mardcC" 0 | |
|
88 | assert "-qAui" "-A" 0 | |
|
89 | assert "-qAu" "-marducC" 0 | |
|
90 | assert "-qAi" "-mardicC" 0 | |
|
90 | 91 | assert "-qu" "-u" 0 |
|
91 | 92 | assert "-q" "-u" 1 |
|
92 | 93 | assert "-m" "-a" 1 |
General Comments 0
You need to be logged in to leave comments.
Login now