Mercurial > hg
annotate tests/test-remove.t @ 25757:4d1382fd96ff
context: write dirstate out explicitly at the end of markcommitted
To detect change of a file without redundant comparison of file
content, dirstate recognizes a file as certainly clean, if:
(1) it is already known as "normal",
(2) dirstate entry for it has valid (= not "-1") timestamp, and
(3) mode, size and timestamp of it on the filesystem are as same as
ones expected in dirstate
This works as expected in many cases, but doesn't in the corner case
that changing a file keeps mode, size and timestamp of it on the
filesystem.
The timetable below shows steps in one of typical such situations:
---- ----------------------------------- ----------------
timestamp of "f"
----------------
dirstate file-
time action mem file system
---- ----------------------------------- ---- ----- -----
* *** ***
- 'hg transplant REV1 REV2 ...'
- transplanting REV1
....
N
- change "f", but keep size N
(via 'patch.patch()')
- 'dirstate.normal("f")' N ***
(via 'repo.commit()')
- transplanting REV2
- change "f", but keep size N
(via 'patch.patch()')
- aborted while patching
N+1
- release wlock
- 'dirstate.write()' N N N
- 'hg status' shows "r1" as "clean" N N N
---- ----------------------------------- ---- ----- -----
The most important point is that 'dirstate.write()' is executed at N+1
or later. This causes writing dirstate timestamp N of "f" out
successfully. If it is executed at N, 'parsers.pack_dirstate()'
replaces timestamp N with "-1" before actual writing dirstate out.
This issue can occur when 'hg transplant' satisfies conditions below:
- multiple revisions to be transplanted change the same file
- those revisions don't change mode and size of the file, and
- the 2nd or later revision of them fails after changing the file
The root cause of this issue is that files are changed without
flushing in-memory dirstate changes via 'repo.commit()' (even though
omitting 'dirstate.normallookup()' on files changed by 'patch.patch()'
for efficiency also causes this issue).
To detect changes of files correctly, this patch writes in-memory
dirstate changes out explicitly after marking files as clean in
'committablectx.markcommitted()', which is invoked via
'repo.commit()'.
After this change, timetable is changed as below:
---- ----------------------------------- ----------------
timestamp of "f"
----------------
dirstate file-
time action mem file system
---- ----------------------------------- ---- ----- -----
* *** ***
- 'hg transplant REV1 REV2 ...'
- transplanting REV1
....
N
- change "f", but keep size N
(via 'patch.patch()')
- 'dirstate.normal("f")' N ***
(via 'repo.commit()')
----------------------------------- ---- ----- -----
- 'dirsttate.write()' -1 -1
----------------------------------- ---- ----- -----
- transplanting REV2
- change "f", but keep size N
(via 'patch.patch()')
- aborted while patching
N+1
- release wlock
- 'dirstate.write()' -1 -1 N
- 'hg status' shows "r1" as "clean" -1 -1 N
---- ----------------------------------- ---- ----- -----
To reproduce this issue in tests certainly, this patch emulates some
timing critical actions as below:
- change "f" at N
'patch.patch()' with 'fakepatchtime.py' explicitly changes mtime
of patched files to "2000-01-01 00:00" (= N).
- 'dirstate.write()' via 'repo.commit()' at N
'fakedirstatewritetime.py' forces 'pack_dirstate()' to use
"2000-01-01 00:00" as "now", only if 'pack_dirstate()' is invoked
via 'committablectx.markcommitted()'.
- 'dirstate.write()' via releasing wlock at N+1 (or "not at N")
'pack_dirstate()' via releasing wlock uses actual timestamp at
runtime as "now", and it should be different from the "2000-01-01
00:00" of "f".
BTW, this patch doesn't test cases below, even though 'patch.patch()'
is used similarly in these cases:
1. failure of 'hg import' or 'hg qpush'
2. success of 'hg import', 'hg qpush' or 'hg transplant'
Case (1) above doesn't cause this kind of issue, because:
- if patching is aborted by conflicts, changed files are committed
changed files are marked as CLEAN, even though they are partially
patched.
- otherwise, dirstate are fully restored by 'dirstateguard'
For example in timetable above, timestamp of "f" in .hg/dirstate
is restored to -1 (or less than N), and subsequent 'hg status' can
detect changes correctly.
Case (2) always causes 'repo.status()' invocation via 'repo.commit()'
just after changing files inside same wlock scope.
---- ----------------------------------- ----------------
timestamp of "f"
----------------
dirstate file-
time action mem file system
---- ----------------------------------- ---- ----- -----
N *** ***
- make file "f" clean N
- execute 'hg foobar'
....
- 'dirstate.normal("f")' N ***
(e.g. via dirty check
or previous 'repo.commit()')
- change "f", but keep size N
- 'repo.status()' (*1)
(via 'repo.commit()')
---- ----------------------------------- ---- ----- -----
At a glance, 'repo.status()' at (*1) seems to cause similar issue (=
"changed files are treated as clean"), but actually doesn't.
'dirstate._lastnormaltime' should be N at (*1) above, because
'dirstate.normal()' via dirty check is finished at N.
Therefore, "f" changed at N (= 'dirstate._lastnormaltime') is forcibly
treated as "unsure" at (*1), and changes are detected as expected (see
'dirstate.status()' for detail).
If 'hg import' is executed with '--no-commit', 'repo.status()' isn't
invoked just after changing files inside same wlock scope.
But preceding 'dirstate.normal()' is invoked inside another wlock
scope via 'cmdutil.bailifchanged()', and in-memory changes should be
flushed at the end of that scope.
Therefore, timestamp N of clean "f" should be replaced by -1, if
'dirstate.write()' is invoked at N. It means that condition of this
issue isn't satisfied.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Wed, 08 Jul 2015 17:01:09 +0900 |
parents | e033a7d444ac |
children | 8cc51c5a9365 |
rev | line source |
---|---|
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
1 $ remove() { |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
2 > hg rm $@ |
19381
e033a7d444ac
tests: do not skip code-checking on some whole files
Simon Heimberg <simohe@besonet.ch>
parents:
18053
diff
changeset
|
3 > echo "exit code: $?" |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
4 > hg st |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
5 > # do not use ls -R, which recurses in .hg subdirs on Mac OS X 10.5 |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
6 > find . -name .hg -prune -o -type f -print | sort |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
7 > hg up -C |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
8 > } |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
9 |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
10 $ hg init a |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
11 $ cd a |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
12 $ echo a > foo |
936 | 13 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
14 file not managed |
6346
8e3b651382f5
improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
4394
diff
changeset
|
15 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
16 $ remove foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
17 not removing foo: file is untracked |
12130 | 18 exit code: 1 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
19 ? foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
20 ./foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
21 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
22 |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
23 $ hg add foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
24 $ hg commit -m1 |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
25 |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
26 the table cases |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
27 00 state added, options none |
6346
8e3b651382f5
improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
4394
diff
changeset
|
28 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
29 $ echo b > bar |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
30 $ hg add bar |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
31 $ remove bar |
15115
c84b3f42d5ae
remove: suggest forget to undo adds
Matt Mackall <mpm@selenic.com>
parents:
12365
diff
changeset
|
32 not removing bar: file has been marked for add (use forget to undo) |
12130 | 33 exit code: 1 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
34 A bar |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
35 ./bar |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
36 ./foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
37 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
6346
8e3b651382f5
improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
4394
diff
changeset
|
38 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
39 01 state clean, options none |
6346
8e3b651382f5
improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
4394
diff
changeset
|
40 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
41 $ remove foo |
12130 | 42 exit code: 0 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
43 R foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
44 ? bar |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
45 ./bar |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
46 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
47 |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
48 02 state modified, options none |
6346
8e3b651382f5
improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
4394
diff
changeset
|
49 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
50 $ echo b >> foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
51 $ remove foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
52 not removing foo: file is modified (use -f to force removal) |
12130 | 53 exit code: 1 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
54 M foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
55 ? bar |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
56 ./bar |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
57 ./foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
58 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
59 |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
60 03 state missing, options none |
6346
8e3b651382f5
improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
4394
diff
changeset
|
61 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
62 $ rm foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
63 $ remove foo |
12130 | 64 exit code: 0 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
65 R foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
66 ? bar |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
67 ./bar |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
68 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
69 |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
70 10 state added, options -f |
6346
8e3b651382f5
improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
4394
diff
changeset
|
71 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
72 $ echo b > bar |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
73 $ hg add bar |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
74 $ remove -f bar |
12130 | 75 exit code: 0 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
76 ? bar |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
77 ./bar |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
78 ./foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
79 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
80 $ rm bar |
6346
8e3b651382f5
improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
4394
diff
changeset
|
81 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
82 11 state clean, options -f |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
83 |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
84 $ remove -f foo |
12130 | 85 exit code: 0 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
86 R foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
87 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
88 |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
89 12 state modified, options -f |
6346
8e3b651382f5
improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
4394
diff
changeset
|
90 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
91 $ echo b >> foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
92 $ remove -f foo |
12130 | 93 exit code: 0 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
94 R foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
95 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
96 |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
97 13 state missing, options -f |
6346
8e3b651382f5
improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
4394
diff
changeset
|
98 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
99 $ rm foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
100 $ remove -f foo |
12130 | 101 exit code: 0 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
102 R foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
103 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
104 |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
105 20 state added, options -A |
6346
8e3b651382f5
improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
4394
diff
changeset
|
106 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
107 $ echo b > bar |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
108 $ hg add bar |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
109 $ remove -A bar |
18053
0c2f0048125d
rm: drop misleading 'use -f' hint for the rm --after 'not removing' warning
Mads Kiilerich <madski@unity3d.com>
parents:
17862
diff
changeset
|
110 not removing bar: file still exists |
12130 | 111 exit code: 1 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
112 A bar |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
113 ./bar |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
114 ./foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
115 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
6346
8e3b651382f5
improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
4394
diff
changeset
|
116 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
117 21 state clean, options -A |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
118 |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
119 $ remove -A foo |
18053
0c2f0048125d
rm: drop misleading 'use -f' hint for the rm --after 'not removing' warning
Mads Kiilerich <madski@unity3d.com>
parents:
17862
diff
changeset
|
120 not removing foo: file still exists |
12130 | 121 exit code: 1 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
122 ? bar |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
123 ./bar |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
124 ./foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
125 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
126 |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
127 22 state modified, options -A |
936 | 128 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
129 $ echo b >> foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
130 $ remove -A foo |
18053
0c2f0048125d
rm: drop misleading 'use -f' hint for the rm --after 'not removing' warning
Mads Kiilerich <madski@unity3d.com>
parents:
17862
diff
changeset
|
131 not removing foo: file still exists |
12130 | 132 exit code: 1 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
133 M foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
134 ? bar |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
135 ./bar |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
136 ./foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
137 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
6346
8e3b651382f5
improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
4394
diff
changeset
|
138 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
139 23 state missing, options -A |
6346
8e3b651382f5
improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
4394
diff
changeset
|
140 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
141 $ rm foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
142 $ remove -A foo |
12130 | 143 exit code: 0 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
144 R foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
145 ? bar |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
146 ./bar |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
147 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
148 |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
149 30 state added, options -Af |
6346
8e3b651382f5
improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
4394
diff
changeset
|
150 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
151 $ echo b > bar |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
152 $ hg add bar |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
153 $ remove -Af bar |
12130 | 154 exit code: 0 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
155 ? bar |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
156 ./bar |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
157 ./foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
158 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
159 $ rm bar |
6346
8e3b651382f5
improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
4394
diff
changeset
|
160 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
161 31 state clean, options -Af |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
162 |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
163 $ remove -Af foo |
12130 | 164 exit code: 0 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
165 R foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
166 ./foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
167 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
6346
8e3b651382f5
improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
4394
diff
changeset
|
168 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
169 32 state modified, options -Af |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
170 |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
171 $ echo b >> foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
172 $ remove -Af foo |
12130 | 173 exit code: 0 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
174 R foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
175 ./foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
176 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
2309
b2f37c7026ca
remove: rewrite to be ~400x faster, bit more friendly
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2180
diff
changeset
|
177 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
178 33 state missing, options -Af |
6346
8e3b651382f5
improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
4394
diff
changeset
|
179 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
180 $ rm foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
181 $ remove -Af foo |
12130 | 182 exit code: 0 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
183 R foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
184 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
185 |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
186 test some directory stuff |
6346
8e3b651382f5
improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
4394
diff
changeset
|
187 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
188 $ mkdir test |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
189 $ echo a > test/foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
190 $ echo b > test/bar |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
191 $ hg ci -Am2 |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
192 adding test/bar |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
193 adding test/foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
194 |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
195 dir, options none |
6346
8e3b651382f5
improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
4394
diff
changeset
|
196 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
197 $ rm test/bar |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
198 $ remove test |
15447
9910f60a37ee
tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents:
15115
diff
changeset
|
199 removing test/bar (glob) |
9910f60a37ee
tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents:
15115
diff
changeset
|
200 removing test/foo (glob) |
12130 | 201 exit code: 0 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
202 R test/bar |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
203 R test/foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
204 ./foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
205 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
206 |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
207 dir, options -f |
6346
8e3b651382f5
improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
4394
diff
changeset
|
208 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
209 $ rm test/bar |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
210 $ remove -f test |
15447
9910f60a37ee
tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents:
15115
diff
changeset
|
211 removing test/bar (glob) |
9910f60a37ee
tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents:
15115
diff
changeset
|
212 removing test/foo (glob) |
12130 | 213 exit code: 0 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
214 R test/bar |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
215 R test/foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
216 ./foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
217 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
218 |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
219 dir, options -A |
6346
8e3b651382f5
improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
4394
diff
changeset
|
220 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
221 $ rm test/bar |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
222 $ remove -A test |
18053
0c2f0048125d
rm: drop misleading 'use -f' hint for the rm --after 'not removing' warning
Mads Kiilerich <madski@unity3d.com>
parents:
17862
diff
changeset
|
223 not removing test/foo: file still exists (glob) |
15447
9910f60a37ee
tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents:
15115
diff
changeset
|
224 removing test/bar (glob) |
12130 | 225 exit code: 1 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
226 R test/bar |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
227 ./foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
228 ./test/foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
229 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
6346
8e3b651382f5
improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
4394
diff
changeset
|
230 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
231 dir, options -Af |
9572
1f665246dab3
windows: fix unlink() not dropping empty tree (issue1861)
Patrick Mezard <pmezard@gmail.com>
parents:
6358
diff
changeset
|
232 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
233 $ rm test/bar |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
234 $ remove -Af test |
15447
9910f60a37ee
tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents:
15115
diff
changeset
|
235 removing test/bar (glob) |
9910f60a37ee
tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents:
15115
diff
changeset
|
236 removing test/foo (glob) |
12130 | 237 exit code: 0 |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
238 R test/bar |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
239 R test/foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
240 ./foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
241 ./test/foo |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
242 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
243 |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
244 test remove dropping empty trees (issue1861) |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
245 |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
246 $ mkdir -p issue1861/b/c |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
247 $ echo x > issue1861/x |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
248 $ echo y > issue1861/b/c/y |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
249 $ hg ci -Am add |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
250 adding issue1861/b/c/y |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
251 adding issue1861/x |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
252 $ hg rm issue1861/b |
15447
9910f60a37ee
tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents:
15115
diff
changeset
|
253 removing issue1861/b/c/y (glob) |
12099
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
254 $ hg ci -m remove |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
255 $ ls issue1861 |
54c9549ccb22
tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9572
diff
changeset
|
256 x |
16904
9d0f988364bd
test-remove-new: integrate into test-remove.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
15447
diff
changeset
|
257 |
9d0f988364bd
test-remove-new: integrate into test-remove.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
15447
diff
changeset
|
258 test that commit does not crash if the user removes a newly added file |
9d0f988364bd
test-remove-new: integrate into test-remove.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
15447
diff
changeset
|
259 |
9d0f988364bd
test-remove-new: integrate into test-remove.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
15447
diff
changeset
|
260 $ touch f1 |
9d0f988364bd
test-remove-new: integrate into test-remove.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
15447
diff
changeset
|
261 $ hg add f1 |
9d0f988364bd
test-remove-new: integrate into test-remove.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
15447
diff
changeset
|
262 $ rm f1 |
9d0f988364bd
test-remove-new: integrate into test-remove.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
15447
diff
changeset
|
263 $ hg ci -A -mx |
9d0f988364bd
test-remove-new: integrate into test-remove.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
15447
diff
changeset
|
264 removing f1 |
9d0f988364bd
test-remove-new: integrate into test-remove.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
15447
diff
changeset
|
265 nothing changed |
9d0f988364bd
test-remove-new: integrate into test-remove.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
15447
diff
changeset
|
266 [1] |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
16904
diff
changeset
|
267 |
17848
66f0c78350ab
remove: don't return error on directories with tracked files
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
268 handling of untracked directories and missing files |
66f0c78350ab
remove: don't return error on directories with tracked files
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
269 |
66f0c78350ab
remove: don't return error on directories with tracked files
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
270 $ mkdir d1 |
66f0c78350ab
remove: don't return error on directories with tracked files
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
271 $ echo a > d1/a |
66f0c78350ab
remove: don't return error on directories with tracked files
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
272 $ hg rm --after d1 |
66f0c78350ab
remove: don't return error on directories with tracked files
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
273 not removing d1: no tracked files |
66f0c78350ab
remove: don't return error on directories with tracked files
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
274 [1] |
66f0c78350ab
remove: don't return error on directories with tracked files
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
275 $ hg add d1/a |
66f0c78350ab
remove: don't return error on directories with tracked files
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
276 $ rm d1/a |
66f0c78350ab
remove: don't return error on directories with tracked files
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
277 $ hg rm --after d1 |
17861
3125af2d99d2
test-remove: fix \ vs. / issues on Windows
Adrian Buehlmann <adrian@cadifra.com>
parents:
17848
diff
changeset
|
278 removing d1/a (glob) |
17862
2142691be14f
test-remove: adapt to differing error message on Windows
Adrian Buehlmann <adrian@cadifra.com>
parents:
17861
diff
changeset
|
279 #if windows |
2142691be14f
test-remove: adapt to differing error message on Windows
Adrian Buehlmann <adrian@cadifra.com>
parents:
17861
diff
changeset
|
280 $ hg rm --after nosuch |
2142691be14f
test-remove: adapt to differing error message on Windows
Adrian Buehlmann <adrian@cadifra.com>
parents:
17861
diff
changeset
|
281 nosuch: * (glob) |
2142691be14f
test-remove: adapt to differing error message on Windows
Adrian Buehlmann <adrian@cadifra.com>
parents:
17861
diff
changeset
|
282 [1] |
2142691be14f
test-remove: adapt to differing error message on Windows
Adrian Buehlmann <adrian@cadifra.com>
parents:
17861
diff
changeset
|
283 #else |
17848
66f0c78350ab
remove: don't return error on directories with tracked files
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
284 $ hg rm --after nosuch |
66f0c78350ab
remove: don't return error on directories with tracked files
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
285 nosuch: No such file or directory |
66f0c78350ab
remove: don't return error on directories with tracked files
Matt Mackall <mpm@selenic.com>
parents:
16913
diff
changeset
|
286 [1] |
17862
2142691be14f
test-remove: adapt to differing error message on Windows
Adrian Buehlmann <adrian@cadifra.com>
parents:
17861
diff
changeset
|
287 #endif |