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