Show More
@@ -2493,6 +2493,9 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 files unless explicitly | |||
|
2497 | requested by -u. | |||
|
2498 | ||||
2496 | NOTE: status may appear to disagree with diff if permissions have |
|
2499 | NOTE: status may appear to disagree with diff if permissions have | |
2497 | 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 | |
2498 | report permission changes and diff only reports changes relative |
|
2501 | report permission changes and diff only reports changes relative | |
@@ -2537,6 +2540,12 b' def status(ui, repo, *pats, **opts):' | |||||
2537 | for opt, char, changes in ([ct for ct in explicit_changetypes |
|
2540 | for opt, char, changes in ([ct for ct in explicit_changetypes | |
2538 | if all or opts[ct[0]]] |
|
2541 | if all or opts[ct[0]]] | |
2539 | or changetypes): |
|
2542 | or changetypes): | |
|
2543 | ||||
|
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 | ||||
2540 | if opts['no_status']: |
|
2549 | if opts['no_status']: | |
2541 | format = "%%s%s" % end |
|
2550 | format = "%%s%s" % end | |
2542 | else: |
|
2551 | else: |
@@ -222,6 +222,9 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 files unless explicitly | |||
|
226 | requested by -u. | |||
|
227 | ||||
225 | NOTE: status may appear to disagree with diff if permissions have |
|
228 | NOTE: status may appear to disagree with diff if permissions have | |
226 | 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 | |
227 | report permission changes and diff only reports changes relative |
|
230 | report permission changes and diff only reports changes relative |
@@ -44,3 +44,51 b' echo "hg status ignoreddir/file:"' | |||||
44 | hg status ignoreddir/file |
|
44 | hg status ignoreddir/file | |
45 | echo "hg status -i ignoreddir/file:" |
|
45 | echo "hg status -i ignoreddir/file:" | |
46 | hg status -i ignoreddir/file |
|
46 | hg status -i ignoreddir/file | |
|
47 | cd .. | |||
|
48 | ||||
|
49 | # check 'status -q' and some combinations | |||
|
50 | hg init repo3 | |||
|
51 | cd repo3 | |||
|
52 | touch modified removed deleted ignored | |||
|
53 | echo "^ignored$" > .hgignore | |||
|
54 | hg commit -A -m 'initial checkin' | |||
|
55 | touch added unknown ignored | |||
|
56 | hg add added | |||
|
57 | echo "test" >> modified | |||
|
58 | hg remove removed | |||
|
59 | rm deleted | |||
|
60 | hg copy modified copied | |||
|
61 | ||||
|
62 | # Run status with 2 different flags. | |||
|
63 | # Check if result is the same or different. | |||
|
64 | # If result is not as expected, raise error | |||
|
65 | function assert { | |||
|
66 | hg status $1 > ../a | |||
|
67 | hg status $2 > ../b | |||
|
68 | out=`diff ../a ../b` | |||
|
69 | if [ $? -ne 0 ]; then | |||
|
70 | out=1 | |||
|
71 | else | |||
|
72 | out=0 | |||
|
73 | fi | |||
|
74 | if [ $3 -eq 0 ]; then | |||
|
75 | df="same" | |||
|
76 | else | |||
|
77 | df="different" | |||
|
78 | fi | |||
|
79 | if [ $out -ne $3 ]; then | |||
|
80 | echo "Error on $1 and $2, should be $df." | |||
|
81 | fi | |||
|
82 | } | |||
|
83 | ||||
|
84 | # assert flag1 flag2 [0-same | 1-different] | |||
|
85 | assert "-q" "-mard" 0 | |||
|
86 | assert "-A" "-mardicCu" 0 | |||
|
87 | assert "-qA" "-mardicCu" 0 | |||
|
88 | assert "-qAu" "-A" 0 | |||
|
89 | assert "-qA" "-A" 0 | |||
|
90 | assert "-qu" "-u" 0 | |||
|
91 | assert "-q" "-u" 1 | |||
|
92 | assert "-m" "-a" 1 | |||
|
93 | assert "-r" "-d" 1 | |||
|
94 |
General Comments 0
You need to be logged in to leave comments.
Login now