Mercurial > hg-stable
annotate tests/test-add.t @ 24790:baa11dde8c0e
match: add a subclass for dirstate normalizing of the matched patterns
This class is only needed on case insensitive filesystems, and only
for wdir context matches. It allows the user to not match the case of
the items in the filesystem- especially for naming directories, which
dirstate doesn't handle[1]. Making dirstate handle mismatched
directory cases is too expensive[2].
Since dirstate doesn't apply to committed csets, this is only created by
overriding basectx.match() in workingctx, and only on icasefs. The default
arguments have been dropped, because the ctx must be passed to the matcher in
order to function.
For operations that can apply to both wdir and some other context, this ends up
normalizing the filename to the case as it exists in the filesystem, and using
that case for the lookup in the other context. See the diff example in the
test.
Previously, given a directory with an inexact case:
- add worked as expected
- diff, forget and status would silently ignore the request
- files would exit with 1
- commit, revert and remove would fail (even when the commands leading up to
them worked):
$ hg ci -m "AbCDef" capsdir1/capsdir
abort: CapsDir1/CapsDir: no match under directory!
$ hg revert -r '.^' capsdir1/capsdir
capsdir1\capsdir: no such file in rev 64dae27060b7
$ hg remove capsdir1/capsdir
not removing capsdir1\capsdir: no tracked files
[1]
Globs are normalized, so that the -I and -X don't need to be specified with a
case match. Without that, the second last remove (with -X) removes the files,
leaving nothing for the last remove. However, specifying the files as
'glob:**.Txt' does not work. Perhaps this requires 're.IGNORECASE'?
There are only a handful of places that create matchers directly, instead of
being routed through the context.match() method. Some may benefit from changing
over to using ctx.match() as a factory function:
revset.checkstatus()
revset.contains()
revset.filelog()
revset._matchfiles()
localrepository._loadfilter()
ignore.ignore()
fileset.subrepo()
filemerge._picktool()
overrides.addlargefiles()
lfcommands.lfconvert()
kwtemplate.__init__()
eolfile.__init__()
eolfile.checkrev()
acl.buildmatch()
Currently, a toplevel subrepo can be named with an inexact case. However, the
path auditor gets in the way of naming _anything_ in the subrepo if the top
level case doesn't match. That is trickier to handle, because there's the user
provided case, the case in the filesystem, and the case stored in .hgsub. This
can be fixed next cycle.
--- a/tests/test-subrepo-deep-nested-change.t
+++ b/tests/test-subrepo-deep-nested-change.t
@@ -170,8 +170,15 @@
R sub1/sub2/test.txt
$ hg update -Cq
$ touch sub1/sub2/folder/bar
+#if icasefs
+ $ hg addremove Sub1/sub2
+ abort: path 'Sub1\sub2' is inside nested repo 'Sub1'
+ [255]
+ $ hg -q addremove sub1/sub2
+#else
$ hg addremove sub1/sub2
adding sub1/sub2/folder/bar (glob)
+#endif
$ hg status -S
A sub1/sub2/folder/bar
? foo/bar/abc
The narrowmatcher class may need to be tweaked when that is fixed.
[1] http://www.selenic.com/pipermail/mercurial-devel/2015-April/068183.html
[2] http://www.selenic.com/pipermail/mercurial-devel/2015-April/068191.html
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sun, 12 Apr 2015 01:39:21 -0400 |
parents | c780a63f61ca |
children | fff8b779e63a |
rev | line source |
---|---|
11795
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
1 $ hg init a |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
2 $ cd a |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
3 $ echo a > a |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
4 $ hg add -n |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
5 adding a |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
6 $ hg st |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
7 ? a |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
8 $ hg add |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
9 adding a |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
10 $ hg st |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
11 A a |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
12 $ hg forget a |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
13 $ hg add |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
14 adding a |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
15 $ hg st |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
16 A a |
5207
212de429e000
make hg add of a removed file unremove the file
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
17 |
11795
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
18 $ echo b > b |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
19 $ hg add -n b |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
20 $ hg st |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
21 A a |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
22 ? b |
12365
22f3353bcc36
tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
23 $ hg add b |
11795
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
24 $ hg st |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
25 A a |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
26 A b |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
27 |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
28 should fail |
5207
212de429e000
make hg add of a removed file unremove the file
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
29 |
11795
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
30 $ hg add b |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
31 b already tracked! |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
32 $ hg st |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
33 A a |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
34 A b |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
35 |
16875
ee9bd7ef0a0e
test-add: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents:
15524
diff
changeset
|
36 #if no-windows |
13962
8b252e826c68
add: introduce a warning message for non-portable filenames (issue2756) (BC)
Adrian Buehlmann <adrian@cadifra.com>
parents:
12399
diff
changeset
|
37 $ echo foo > con.xml |
8b252e826c68
add: introduce a warning message for non-portable filenames (issue2756) (BC)
Adrian Buehlmann <adrian@cadifra.com>
parents:
12399
diff
changeset
|
38 $ hg --config ui.portablefilenames=jump add con.xml |
8b252e826c68
add: introduce a warning message for non-portable filenames (issue2756) (BC)
Adrian Buehlmann <adrian@cadifra.com>
parents:
12399
diff
changeset
|
39 abort: ui.portablefilenames value is invalid ('jump') |
8b252e826c68
add: introduce a warning message for non-portable filenames (issue2756) (BC)
Adrian Buehlmann <adrian@cadifra.com>
parents:
12399
diff
changeset
|
40 [255] |
8b252e826c68
add: introduce a warning message for non-portable filenames (issue2756) (BC)
Adrian Buehlmann <adrian@cadifra.com>
parents:
12399
diff
changeset
|
41 $ hg --config ui.portablefilenames=abort add con.xml |
8b252e826c68
add: introduce a warning message for non-portable filenames (issue2756) (BC)
Adrian Buehlmann <adrian@cadifra.com>
parents:
12399
diff
changeset
|
42 abort: filename contains 'con', which is reserved on Windows: 'con.xml' |
8b252e826c68
add: introduce a warning message for non-portable filenames (issue2756) (BC)
Adrian Buehlmann <adrian@cadifra.com>
parents:
12399
diff
changeset
|
43 [255] |
8b252e826c68
add: introduce a warning message for non-portable filenames (issue2756) (BC)
Adrian Buehlmann <adrian@cadifra.com>
parents:
12399
diff
changeset
|
44 $ hg st |
8b252e826c68
add: introduce a warning message for non-portable filenames (issue2756) (BC)
Adrian Buehlmann <adrian@cadifra.com>
parents:
12399
diff
changeset
|
45 A a |
8b252e826c68
add: introduce a warning message for non-portable filenames (issue2756) (BC)
Adrian Buehlmann <adrian@cadifra.com>
parents:
12399
diff
changeset
|
46 A b |
8b252e826c68
add: introduce a warning message for non-portable filenames (issue2756) (BC)
Adrian Buehlmann <adrian@cadifra.com>
parents:
12399
diff
changeset
|
47 ? con.xml |
8b252e826c68
add: introduce a warning message for non-portable filenames (issue2756) (BC)
Adrian Buehlmann <adrian@cadifra.com>
parents:
12399
diff
changeset
|
48 $ hg add con.xml |
8b252e826c68
add: introduce a warning message for non-portable filenames (issue2756) (BC)
Adrian Buehlmann <adrian@cadifra.com>
parents:
12399
diff
changeset
|
49 warning: filename contains 'con', which is reserved on Windows: 'con.xml' |
8b252e826c68
add: introduce a warning message for non-portable filenames (issue2756) (BC)
Adrian Buehlmann <adrian@cadifra.com>
parents:
12399
diff
changeset
|
50 $ hg st |
8b252e826c68
add: introduce a warning message for non-portable filenames (issue2756) (BC)
Adrian Buehlmann <adrian@cadifra.com>
parents:
12399
diff
changeset
|
51 A a |
8b252e826c68
add: introduce a warning message for non-portable filenames (issue2756) (BC)
Adrian Buehlmann <adrian@cadifra.com>
parents:
12399
diff
changeset
|
52 A b |
8b252e826c68
add: introduce a warning message for non-portable filenames (issue2756) (BC)
Adrian Buehlmann <adrian@cadifra.com>
parents:
12399
diff
changeset
|
53 A con.xml |
16974
01ed5bb5cd41
tests: use hghave eol-in-paths to test for support for ':' in filenames and " "
Mads Kiilerich <mads@kiilerich.com>
parents:
16913
diff
changeset
|
54 $ hg forget con.xml |
01ed5bb5cd41
tests: use hghave eol-in-paths to test for support for ':' in filenames and " "
Mads Kiilerich <mads@kiilerich.com>
parents:
16913
diff
changeset
|
55 $ rm con.xml |
01ed5bb5cd41
tests: use hghave eol-in-paths to test for support for ':' in filenames and " "
Mads Kiilerich <mads@kiilerich.com>
parents:
16913
diff
changeset
|
56 #endif |
01ed5bb5cd41
tests: use hghave eol-in-paths to test for support for ':' in filenames and " "
Mads Kiilerich <mads@kiilerich.com>
parents:
16913
diff
changeset
|
57 |
01ed5bb5cd41
tests: use hghave eol-in-paths to test for support for ':' in filenames and " "
Mads Kiilerich <mads@kiilerich.com>
parents:
16913
diff
changeset
|
58 #if eol-in-paths |
13962
8b252e826c68
add: introduce a warning message for non-portable filenames (issue2756) (BC)
Adrian Buehlmann <adrian@cadifra.com>
parents:
12399
diff
changeset
|
59 $ echo bla > 'hello:world' |
8b252e826c68
add: introduce a warning message for non-portable filenames (issue2756) (BC)
Adrian Buehlmann <adrian@cadifra.com>
parents:
12399
diff
changeset
|
60 $ hg --config ui.portablefilenames=abort add |
8b252e826c68
add: introduce a warning message for non-portable filenames (issue2756) (BC)
Adrian Buehlmann <adrian@cadifra.com>
parents:
12399
diff
changeset
|
61 adding hello:world |
8b252e826c68
add: introduce a warning message for non-portable filenames (issue2756) (BC)
Adrian Buehlmann <adrian@cadifra.com>
parents:
12399
diff
changeset
|
62 abort: filename contains ':', which is reserved on Windows: 'hello:world' |
8b252e826c68
add: introduce a warning message for non-portable filenames (issue2756) (BC)
Adrian Buehlmann <adrian@cadifra.com>
parents:
12399
diff
changeset
|
63 [255] |
8b252e826c68
add: introduce a warning message for non-portable filenames (issue2756) (BC)
Adrian Buehlmann <adrian@cadifra.com>
parents:
12399
diff
changeset
|
64 $ hg st |
8b252e826c68
add: introduce a warning message for non-portable filenames (issue2756) (BC)
Adrian Buehlmann <adrian@cadifra.com>
parents:
12399
diff
changeset
|
65 A a |
8b252e826c68
add: introduce a warning message for non-portable filenames (issue2756) (BC)
Adrian Buehlmann <adrian@cadifra.com>
parents:
12399
diff
changeset
|
66 A b |
8b252e826c68
add: introduce a warning message for non-portable filenames (issue2756) (BC)
Adrian Buehlmann <adrian@cadifra.com>
parents:
12399
diff
changeset
|
67 ? hello:world |
8b252e826c68
add: introduce a warning message for non-portable filenames (issue2756) (BC)
Adrian Buehlmann <adrian@cadifra.com>
parents:
12399
diff
changeset
|
68 $ hg --config ui.portablefilenames=ignore add |
8b252e826c68
add: introduce a warning message for non-portable filenames (issue2756) (BC)
Adrian Buehlmann <adrian@cadifra.com>
parents:
12399
diff
changeset
|
69 adding hello:world |
8b252e826c68
add: introduce a warning message for non-portable filenames (issue2756) (BC)
Adrian Buehlmann <adrian@cadifra.com>
parents:
12399
diff
changeset
|
70 $ hg st |
8b252e826c68
add: introduce a warning message for non-portable filenames (issue2756) (BC)
Adrian Buehlmann <adrian@cadifra.com>
parents:
12399
diff
changeset
|
71 A a |
8b252e826c68
add: introduce a warning message for non-portable filenames (issue2756) (BC)
Adrian Buehlmann <adrian@cadifra.com>
parents:
12399
diff
changeset
|
72 A b |
8b252e826c68
add: introduce a warning message for non-portable filenames (issue2756) (BC)
Adrian Buehlmann <adrian@cadifra.com>
parents:
12399
diff
changeset
|
73 A hello:world |
16875
ee9bd7ef0a0e
test-add: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents:
15524
diff
changeset
|
74 #endif |
13962
8b252e826c68
add: introduce a warning message for non-portable filenames (issue2756) (BC)
Adrian Buehlmann <adrian@cadifra.com>
parents:
12399
diff
changeset
|
75 |
11795
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
76 $ hg ci -m 0 --traceback |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
77 |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
78 should fail |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
79 |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
80 $ hg add a |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
81 a already tracked! |
5207
212de429e000
make hg add of a removed file unremove the file
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
82 |
11795
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
83 $ echo aa > a |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
84 $ hg ci -m 1 |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
85 $ hg up 0 |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
86 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
87 $ echo aaa > a |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
88 $ hg ci -m 2 |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
89 created new head |
5207
212de429e000
make hg add of a removed file unremove the file
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
90 |
11795
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
91 $ hg merge |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
92 merging a |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
93 warning: conflicts during merge. |
15501
2371f4aea665
merge: give a special message for internal:merge failure (issue3105)
Matt Mackall <mpm@selenic.com>
parents:
15444
diff
changeset
|
94 merging a incomplete! (edit conflicts, then use 'hg resolve --mark') |
11795
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
95 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
12314
f2daa6ab514a
merge: suggest 'hg up -C .' for discarding changes, not 'hg up -C'
Brodie Rao <brodie@bitheap.org>
parents:
11795
diff
changeset
|
96 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12314
diff
changeset
|
97 [1] |
11795
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
98 $ hg st |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
99 M a |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
100 ? a.orig |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
101 |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
102 should fail |
5207
212de429e000
make hg add of a removed file unremove the file
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff
changeset
|
103 |
11795
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
104 $ hg add a |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
105 a already tracked! |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
106 $ hg st |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
107 M a |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
108 ? a.orig |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
109 $ hg resolve -m a |
21947
b081decd9062
resolve: add parenthesis around "no more unresolved files" message
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
21267
diff
changeset
|
110 (no more unresolved files) |
11795
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
111 $ hg ci -m merge |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
112 |
12399
4fee1fd3de9a
tests: added a short description to issue numbers
Martin Geisler <mg@aragost.com>
parents:
12365
diff
changeset
|
113 Issue683: peculiarity with hg revert of an removed then added file |
5688
883d887c6408
commands: add exits(1) if a specified file cannot be added (issue 891)
Patrick Mezard <pmezard@gmail.com>
parents:
5207
diff
changeset
|
114 |
11795
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
115 $ hg forget a |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
116 $ hg add a |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
117 $ hg st |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
118 ? a.orig |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
119 $ hg rm a |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
120 $ hg st |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
121 R a |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
122 ? a.orig |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
123 $ echo a > a |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
124 $ hg add a |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
125 $ hg st |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
126 M a |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
127 ? a.orig |
5688
883d887c6408
commands: add exits(1) if a specified file cannot be added (issue 891)
Patrick Mezard <pmezard@gmail.com>
parents:
5207
diff
changeset
|
128 |
23258
10697f29af2b
add: add back forgotten files even when not matching exactly (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
21947
diff
changeset
|
129 Forgotten file can be added back (as either clean or modified) |
10697f29af2b
add: add back forgotten files even when not matching exactly (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
21947
diff
changeset
|
130 |
10697f29af2b
add: add back forgotten files even when not matching exactly (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
21947
diff
changeset
|
131 $ hg forget b |
10697f29af2b
add: add back forgotten files even when not matching exactly (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
21947
diff
changeset
|
132 $ hg add b |
10697f29af2b
add: add back forgotten files even when not matching exactly (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
21947
diff
changeset
|
133 $ hg st -A b |
10697f29af2b
add: add back forgotten files even when not matching exactly (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
21947
diff
changeset
|
134 C b |
10697f29af2b
add: add back forgotten files even when not matching exactly (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
21947
diff
changeset
|
135 $ hg forget b |
10697f29af2b
add: add back forgotten files even when not matching exactly (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
21947
diff
changeset
|
136 $ echo modified > b |
10697f29af2b
add: add back forgotten files even when not matching exactly (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
21947
diff
changeset
|
137 $ hg add b |
10697f29af2b
add: add back forgotten files even when not matching exactly (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
21947
diff
changeset
|
138 $ hg st -A b |
10697f29af2b
add: add back forgotten files even when not matching exactly (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
21947
diff
changeset
|
139 M b |
10697f29af2b
add: add back forgotten files even when not matching exactly (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
21947
diff
changeset
|
140 $ hg revert -qC b |
10697f29af2b
add: add back forgotten files even when not matching exactly (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
21947
diff
changeset
|
141 |
11795
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
142 $ hg add c && echo "unexpected addition of missing file" |
15521
117f9190c1ba
tests: hide 'No such file or directory' messages
Mads Kiilerich <mads@kiilerich.com>
parents:
15444
diff
changeset
|
143 c: * (glob) |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12314
diff
changeset
|
144 [1] |
11795
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
145 $ echo c > c |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
146 $ hg add d c && echo "unexpected addition of missing file" |
15521
117f9190c1ba
tests: hide 'No such file or directory' messages
Mads Kiilerich <mads@kiilerich.com>
parents:
15444
diff
changeset
|
147 d: * (glob) |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12314
diff
changeset
|
148 [1] |
11795
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
149 $ hg st |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
150 M a |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
151 A c |
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
152 ? a.orig |
19987
ba6486076429
merge: move forgets to the beginning of the action list
Siddharth Agarwal <sid0@fb.com>
parents:
16974
diff
changeset
|
153 $ hg up -C |
ba6486076429
merge: move forgets to the beginning of the action list
Siddharth Agarwal <sid0@fb.com>
parents:
16974
diff
changeset
|
154 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
ba6486076429
merge: move forgets to the beginning of the action list
Siddharth Agarwal <sid0@fb.com>
parents:
16974
diff
changeset
|
155 |
ba6486076429
merge: move forgets to the beginning of the action list
Siddharth Agarwal <sid0@fb.com>
parents:
16974
diff
changeset
|
156 forget and get should have the right order: added but missing dir should be |
ba6486076429
merge: move forgets to the beginning of the action list
Siddharth Agarwal <sid0@fb.com>
parents:
16974
diff
changeset
|
157 forgotten before file with same name is added |
ba6486076429
merge: move forgets to the beginning of the action list
Siddharth Agarwal <sid0@fb.com>
parents:
16974
diff
changeset
|
158 |
ba6486076429
merge: move forgets to the beginning of the action list
Siddharth Agarwal <sid0@fb.com>
parents:
16974
diff
changeset
|
159 $ echo file d > d |
ba6486076429
merge: move forgets to the beginning of the action list
Siddharth Agarwal <sid0@fb.com>
parents:
16974
diff
changeset
|
160 $ hg add d |
ba6486076429
merge: move forgets to the beginning of the action list
Siddharth Agarwal <sid0@fb.com>
parents:
16974
diff
changeset
|
161 $ hg ci -md |
ba6486076429
merge: move forgets to the beginning of the action list
Siddharth Agarwal <sid0@fb.com>
parents:
16974
diff
changeset
|
162 $ hg rm d |
ba6486076429
merge: move forgets to the beginning of the action list
Siddharth Agarwal <sid0@fb.com>
parents:
16974
diff
changeset
|
163 $ mkdir d |
ba6486076429
merge: move forgets to the beginning of the action list
Siddharth Agarwal <sid0@fb.com>
parents:
16974
diff
changeset
|
164 $ echo a > d/a |
ba6486076429
merge: move forgets to the beginning of the action list
Siddharth Agarwal <sid0@fb.com>
parents:
16974
diff
changeset
|
165 $ hg add d/a |
ba6486076429
merge: move forgets to the beginning of the action list
Siddharth Agarwal <sid0@fb.com>
parents:
16974
diff
changeset
|
166 $ rm -r d |
ba6486076429
merge: move forgets to the beginning of the action list
Siddharth Agarwal <sid0@fb.com>
parents:
16974
diff
changeset
|
167 $ hg up -C |
ba6486076429
merge: move forgets to the beginning of the action list
Siddharth Agarwal <sid0@fb.com>
parents:
16974
diff
changeset
|
168 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
ba6486076429
merge: move forgets to the beginning of the action list
Siddharth Agarwal <sid0@fb.com>
parents:
16974
diff
changeset
|
169 $ cat d |
ba6486076429
merge: move forgets to the beginning of the action list
Siddharth Agarwal <sid0@fb.com>
parents:
16974
diff
changeset
|
170 file d |
11795
06793ad30575
tests: unify test-add
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9166
diff
changeset
|
171 |
24537
2bb13f2b778c
dirstate: don't require exact case when adding dirs on icasefs (issue4578)
Matt Harbison <matt_harbison@yahoo.com>
parents:
23258
diff
changeset
|
172 Test that adding a directory doesn't require case matching (issue4578) |
2bb13f2b778c
dirstate: don't require exact case when adding dirs on icasefs (issue4578)
Matt Harbison <matt_harbison@yahoo.com>
parents:
23258
diff
changeset
|
173 #if icasefs |
2bb13f2b778c
dirstate: don't require exact case when adding dirs on icasefs (issue4578)
Matt Harbison <matt_harbison@yahoo.com>
parents:
23258
diff
changeset
|
174 $ mkdir -p CapsDir1/CapsDir |
2bb13f2b778c
dirstate: don't require exact case when adding dirs on icasefs (issue4578)
Matt Harbison <matt_harbison@yahoo.com>
parents:
23258
diff
changeset
|
175 $ echo abc > CapsDir1/CapsDir/AbC.txt |
2bb13f2b778c
dirstate: don't require exact case when adding dirs on icasefs (issue4578)
Matt Harbison <matt_harbison@yahoo.com>
parents:
23258
diff
changeset
|
176 $ mkdir CapsDir1/CapsDir/SubDir |
2bb13f2b778c
dirstate: don't require exact case when adding dirs on icasefs (issue4578)
Matt Harbison <matt_harbison@yahoo.com>
parents:
23258
diff
changeset
|
177 $ echo def > CapsDir1/CapsDir/SubDir/Def.txt |
2bb13f2b778c
dirstate: don't require exact case when adding dirs on icasefs (issue4578)
Matt Harbison <matt_harbison@yahoo.com>
parents:
23258
diff
changeset
|
178 |
24790
baa11dde8c0e
match: add a subclass for dirstate normalizing of the matched patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
24548
diff
changeset
|
179 $ hg add capsdir1/capsdir |
24537
2bb13f2b778c
dirstate: don't require exact case when adding dirs on icasefs (issue4578)
Matt Harbison <matt_harbison@yahoo.com>
parents:
23258
diff
changeset
|
180 adding CapsDir1/CapsDir/AbC.txt (glob) |
2bb13f2b778c
dirstate: don't require exact case when adding dirs on icasefs (issue4578)
Matt Harbison <matt_harbison@yahoo.com>
parents:
23258
diff
changeset
|
181 adding CapsDir1/CapsDir/SubDir/Def.txt (glob) |
24548
c780a63f61ca
forget: cleanup the output for an inexact case match on icasefs
Matt Harbison <matt_harbison@yahoo.com>
parents:
24537
diff
changeset
|
182 |
c780a63f61ca
forget: cleanup the output for an inexact case match on icasefs
Matt Harbison <matt_harbison@yahoo.com>
parents:
24537
diff
changeset
|
183 $ hg forget capsdir1/capsdir/abc.txt |
c780a63f61ca
forget: cleanup the output for an inexact case match on icasefs
Matt Harbison <matt_harbison@yahoo.com>
parents:
24537
diff
changeset
|
184 removing CapsDir1/CapsDir/AbC.txt (glob) |
24790
baa11dde8c0e
match: add a subclass for dirstate normalizing of the matched patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
24548
diff
changeset
|
185 |
baa11dde8c0e
match: add a subclass for dirstate normalizing of the matched patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
24548
diff
changeset
|
186 $ hg forget capsdir1/capsdir |
baa11dde8c0e
match: add a subclass for dirstate normalizing of the matched patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
24548
diff
changeset
|
187 removing CapsDir1/CapsDir/SubDir/Def.txt (glob) |
baa11dde8c0e
match: add a subclass for dirstate normalizing of the matched patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
24548
diff
changeset
|
188 |
baa11dde8c0e
match: add a subclass for dirstate normalizing of the matched patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
24548
diff
changeset
|
189 $ hg add capsdir1 |
baa11dde8c0e
match: add a subclass for dirstate normalizing of the matched patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
24548
diff
changeset
|
190 adding CapsDir1/CapsDir/AbC.txt (glob) |
baa11dde8c0e
match: add a subclass for dirstate normalizing of the matched patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
24548
diff
changeset
|
191 adding CapsDir1/CapsDir/SubDir/Def.txt (glob) |
baa11dde8c0e
match: add a subclass for dirstate normalizing of the matched patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
24548
diff
changeset
|
192 |
baa11dde8c0e
match: add a subclass for dirstate normalizing of the matched patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
24548
diff
changeset
|
193 $ hg ci -m "AbCDef" capsdir1/capsdir |
baa11dde8c0e
match: add a subclass for dirstate normalizing of the matched patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
24548
diff
changeset
|
194 |
baa11dde8c0e
match: add a subclass for dirstate normalizing of the matched patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
24548
diff
changeset
|
195 $ hg status -A capsdir1/capsdir |
baa11dde8c0e
match: add a subclass for dirstate normalizing of the matched patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
24548
diff
changeset
|
196 C CapsDir1/CapsDir/AbC.txt |
baa11dde8c0e
match: add a subclass for dirstate normalizing of the matched patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
24548
diff
changeset
|
197 C CapsDir1/CapsDir/SubDir/Def.txt |
baa11dde8c0e
match: add a subclass for dirstate normalizing of the matched patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
24548
diff
changeset
|
198 |
baa11dde8c0e
match: add a subclass for dirstate normalizing of the matched patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
24548
diff
changeset
|
199 $ hg files capsdir1/capsdir |
baa11dde8c0e
match: add a subclass for dirstate normalizing of the matched patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
24548
diff
changeset
|
200 CapsDir1/CapsDir/AbC.txt (glob) |
baa11dde8c0e
match: add a subclass for dirstate normalizing of the matched patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
24548
diff
changeset
|
201 CapsDir1/CapsDir/SubDir/Def.txt (glob) |
baa11dde8c0e
match: add a subclass for dirstate normalizing of the matched patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
24548
diff
changeset
|
202 |
baa11dde8c0e
match: add a subclass for dirstate normalizing of the matched patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
24548
diff
changeset
|
203 $ echo xyz > CapsDir1/CapsDir/SubDir/Def.txt |
baa11dde8c0e
match: add a subclass for dirstate normalizing of the matched patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
24548
diff
changeset
|
204 $ hg ci -m xyz capsdir1/capsdir/subdir/def.txt |
baa11dde8c0e
match: add a subclass for dirstate normalizing of the matched patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
24548
diff
changeset
|
205 |
baa11dde8c0e
match: add a subclass for dirstate normalizing of the matched patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
24548
diff
changeset
|
206 $ hg revert -r '.^' capsdir1/capsdir |
baa11dde8c0e
match: add a subclass for dirstate normalizing of the matched patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
24548
diff
changeset
|
207 reverting CapsDir1/CapsDir/SubDir/Def.txt (glob) |
baa11dde8c0e
match: add a subclass for dirstate normalizing of the matched patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
24548
diff
changeset
|
208 |
baa11dde8c0e
match: add a subclass for dirstate normalizing of the matched patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
24548
diff
changeset
|
209 $ hg diff capsdir1/capsdir |
baa11dde8c0e
match: add a subclass for dirstate normalizing of the matched patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
24548
diff
changeset
|
210 diff -r 5112e00e781d CapsDir1/CapsDir/SubDir/Def.txt |
baa11dde8c0e
match: add a subclass for dirstate normalizing of the matched patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
24548
diff
changeset
|
211 --- a/CapsDir1/CapsDir/SubDir/Def.txt Thu Jan 01 00:00:00 1970 +0000 |
baa11dde8c0e
match: add a subclass for dirstate normalizing of the matched patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
24548
diff
changeset
|
212 +++ b/CapsDir1/CapsDir/SubDir/Def.txt * +0000 (glob) |
baa11dde8c0e
match: add a subclass for dirstate normalizing of the matched patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
24548
diff
changeset
|
213 @@ -1,1 +1,1 @@ |
baa11dde8c0e
match: add a subclass for dirstate normalizing of the matched patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
24548
diff
changeset
|
214 -xyz |
baa11dde8c0e
match: add a subclass for dirstate normalizing of the matched patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
24548
diff
changeset
|
215 +def |
baa11dde8c0e
match: add a subclass for dirstate normalizing of the matched patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
24548
diff
changeset
|
216 |
baa11dde8c0e
match: add a subclass for dirstate normalizing of the matched patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
24548
diff
changeset
|
217 $ hg remove -f 'glob:**.txt' -X capsdir1/capsdir |
baa11dde8c0e
match: add a subclass for dirstate normalizing of the matched patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
24548
diff
changeset
|
218 $ hg remove -f 'glob:**.txt' -I capsdir1/capsdir |
baa11dde8c0e
match: add a subclass for dirstate normalizing of the matched patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
24548
diff
changeset
|
219 removing CapsDir1/CapsDir/AbC.txt (glob) |
baa11dde8c0e
match: add a subclass for dirstate normalizing of the matched patterns
Matt Harbison <matt_harbison@yahoo.com>
parents:
24548
diff
changeset
|
220 removing CapsDir1/CapsDir/SubDir/Def.txt (glob) |
24537
2bb13f2b778c
dirstate: don't require exact case when adding dirs on icasefs (issue4578)
Matt Harbison <matt_harbison@yahoo.com>
parents:
23258
diff
changeset
|
221 #endif |
2bb13f2b778c
dirstate: don't require exact case when adding dirs on icasefs (issue4578)
Matt Harbison <matt_harbison@yahoo.com>
parents:
23258
diff
changeset
|
222 |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
16875
diff
changeset
|
223 $ cd .. |