tests/test-remove.t
author timeless <timeless@mozdev.org>
Thu, 17 Mar 2016 18:19:36 +0000
changeset 28607 a88959ae5938
parent 28606 8cc51c5a9365
child 28608 62e73d42bd14
permissions -rw-r--r--
remove: queue warnings until after status messages (issue5140) (API) Before this change, warnings were interspersed with (and easily drowned out by) status messages. API: abstractsubrepo.removefiles has an extra argument warnings, into which callees should append their warnings. Note: Callees should not assume that there will be items in the list, today, I'm lazily including any other subrepos warnings, but that may change. cmdutil.remove has an extra optional argument warnings, into which it will place warnings. If warnings is omitted, warnings will be reported via ui.warn() as before this change (albeit, after any status messages).
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
28606
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
    10
  $ cat >> $HGRCPATH <<EOF
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
    11
  > [progress]
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
    12
  > disable=False
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
    13
  > assume-tty = 1
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
    14
  > delay = 0
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
    15
  > # set changedelay really large so we don't see nested topics
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
    16
  > changedelay = 30000
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
    17
  > format = topic bar number
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
    18
  > refresh = 0
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
    19
  > width = 60
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
    20
  > EOF
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
    21
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    22
  $ hg init a
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    23
  $ cd a
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    24
  $ echo a > foo
936
b62d1e738fa9 Add a simple remove test
mpm@selenic.com
parents:
diff changeset
    25
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    26
file not managed
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
    27
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    28
  $ remove foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    29
  not removing foo: file is untracked
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
    30
  exit code: 1
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    31
  ? foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    32
  ./foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    33
  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
    34
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    35
  $ hg add foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    36
  $ hg commit -m1
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    37
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    38
the table cases
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    39
00 state added, 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
  $ echo b > bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    42
  $ hg add bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    43
  $ remove bar
15115
c84b3f42d5ae remove: suggest forget to undo adds
Matt Mackall <mpm@selenic.com>
parents: 12365
diff changeset
    44
  not removing bar: file has been marked for add (use forget to undo)
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
    45
  exit code: 1
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    46
  A bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    47
  ./bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    48
  ./foo
28606
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
    49
  \r (no-eol) (esc)
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
    50
  updating [===========================================>] 1/1\r (no-eol) (esc)
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
    51
                                                              \r (no-eol) (esc)
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    52
  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
    53
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    54
01 state clean, options none
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
    55
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    56
  $ remove foo
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
    57
  exit code: 0
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    58
  R foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    59
  ? bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    60
  ./bar
28606
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
    61
  \r (no-eol) (esc)
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
    62
  updating [===========================================>] 1/1\r (no-eol) (esc)
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
    63
                                                              \r (no-eol) (esc)
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    64
  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
    65
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    66
02 state modified, options none
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
    67
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    68
  $ echo b >> foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    69
  $ remove foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    70
  not removing foo: file is modified (use -f to force removal)
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
    71
  exit code: 1
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    72
  M foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    73
  ? bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    74
  ./bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    75
  ./foo
28606
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
    76
  \r (no-eol) (esc)
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
    77
  updating [===========================================>] 1/1\r (no-eol) (esc)
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
    78
                                                              \r (no-eol) (esc)
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    79
  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
    80
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    81
03 state missing, options none
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
    82
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    83
  $ rm foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    84
  $ remove foo
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
    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
  ? bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    88
  ./bar
28606
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
    89
  \r (no-eol) (esc)
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
    90
  updating [===========================================>] 1/1\r (no-eol) (esc)
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
    91
                                                              \r (no-eol) (esc)
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    92
  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
    93
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    94
10 state added, options -f
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
    95
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    96
  $ echo b > bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    97
  $ hg add bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
    98
  $ remove -f bar
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
    99
  exit code: 0
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   100
  ? bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   101
  ./bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   102
  ./foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   103
  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
   104
  $ rm bar
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
   105
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   106
11 state clean, options -f
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   107
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   108
  $ remove -f foo
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
   109
  exit code: 0
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   110
  R foo
28606
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
   111
  \r (no-eol) (esc)
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
   112
  updating [===========================================>] 1/1\r (no-eol) (esc)
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
   113
                                                              \r (no-eol) (esc)
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   114
  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
   115
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   116
12 state modified, options -f
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
   117
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   118
  $ echo b >> foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   119
  $ remove -f foo
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
   120
  exit code: 0
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   121
  R foo
28606
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
   122
  \r (no-eol) (esc)
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
   123
  updating [===========================================>] 1/1\r (no-eol) (esc)
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
   124
                                                              \r (no-eol) (esc)
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   125
  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
   126
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   127
13 state missing, options -f
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
   128
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   129
  $ rm foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   130
  $ remove -f foo
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
   131
  exit code: 0
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   132
  R foo
28606
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
   133
  \r (no-eol) (esc)
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
   134
  updating [===========================================>] 1/1\r (no-eol) (esc)
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
   135
                                                              \r (no-eol) (esc)
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   136
  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
   137
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   138
20 state added, options -A
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
   139
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   140
  $ echo b > bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   141
  $ hg add bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   142
  $ 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
   143
  not removing bar: file still exists
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
   144
  exit code: 1
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   145
  A 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
  ./foo
28606
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
   148
  \r (no-eol) (esc)
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
   149
  updating [===========================================>] 1/1\r (no-eol) (esc)
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
   150
                                                              \r (no-eol) (esc)
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   151
  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
   152
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   153
21 state clean, options -A
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   154
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   155
  $ 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
   156
  not removing foo: file still exists
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
   157
  exit code: 1
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   158
  ? bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   159
  ./bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   160
  ./foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   161
  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
   162
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   163
22 state modified, options -A
936
b62d1e738fa9 Add a simple remove test
mpm@selenic.com
parents:
diff changeset
   164
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   165
  $ echo b >> foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   166
  $ 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
   167
  not removing foo: file still exists
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
   168
  exit code: 1
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   169
  M foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   170
  ? bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   171
  ./bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   172
  ./foo
28606
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
   173
  \r (no-eol) (esc)
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
   174
  updating [===========================================>] 1/1\r (no-eol) (esc)
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
   175
                                                              \r (no-eol) (esc)
12099
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
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
   177
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   178
23 state missing, options -A
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 -A foo
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
   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
  ? bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   185
  ./bar
28606
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
   186
  \r (no-eol) (esc)
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
   187
  updating [===========================================>] 1/1\r (no-eol) (esc)
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
   188
                                                              \r (no-eol) (esc)
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   189
  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
   190
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   191
30 state added, options -Af
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
   192
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   193
  $ echo b > bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   194
  $ hg add bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   195
  $ remove -Af bar
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
   196
  exit code: 0
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   197
  ? bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   198
  ./bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   199
  ./foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   200
  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
   201
  $ rm bar
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
   202
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   203
31 state clean, options -Af
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   204
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   205
  $ remove -Af foo
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
   206
  exit code: 0
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   207
  R foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   208
  ./foo
28606
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
   209
  \r (no-eol) (esc)
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
   210
  updating [===========================================>] 1/1\r (no-eol) (esc)
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
   211
                                                              \r (no-eol) (esc)
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   212
  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
   213
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   214
32 state modified, options -Af
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   215
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   216
  $ echo b >> foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   217
  $ remove -Af foo
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
   218
  exit code: 0
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   219
  R foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   220
  ./foo
28606
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
   221
  \r (no-eol) (esc)
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
   222
  updating [===========================================>] 1/1\r (no-eol) (esc)
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
   223
                                                              \r (no-eol) (esc)
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   224
  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
   225
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   226
33 state missing, options -Af
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
   227
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   228
  $ rm foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   229
  $ remove -Af foo
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
   230
  exit code: 0
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   231
  R foo
28606
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
   232
  \r (no-eol) (esc)
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
   233
  updating [===========================================>] 1/1\r (no-eol) (esc)
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
   234
                                                              \r (no-eol) (esc)
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   235
  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
   236
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   237
test some directory stuff
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
   238
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   239
  $ mkdir test
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   240
  $ echo a > test/foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   241
  $ echo b > test/bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   242
  $ hg ci -Am2
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   243
  adding test/bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   244
  adding test/foo
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
dir, options none
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
   247
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   248
  $ rm test/bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   249
  $ remove test
15447
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 15115
diff changeset
   250
  removing test/bar (glob)
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 15115
diff changeset
   251
  removing test/foo (glob)
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
   252
  exit code: 0
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   253
  R test/bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   254
  R test/foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   255
  ./foo
28606
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
   256
  \r (no-eol) (esc)
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
   257
  updating [===========================================>] 2/2\r (no-eol) (esc)
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
   258
                                                              \r (no-eol) (esc)
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   259
  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
   260
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   261
dir, options -f
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
   262
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   263
  $ rm test/bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   264
  $ remove -f test
15447
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 15115
diff changeset
   265
  removing test/bar (glob)
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 15115
diff changeset
   266
  removing test/foo (glob)
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
   267
  exit code: 0
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   268
  R test/bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   269
  R test/foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   270
  ./foo
28606
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
   271
  \r (no-eol) (esc)
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
   272
  updating [===========================================>] 2/2\r (no-eol) (esc)
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
   273
                                                              \r (no-eol) (esc)
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   274
  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
   275
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   276
dir, options -A
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
   277
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   278
  $ rm test/bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   279
  $ remove -A test
28607
a88959ae5938 remove: queue warnings until after status messages (issue5140) (API)
timeless <timeless@mozdev.org>
parents: 28606
diff changeset
   280
  removing test/bar (glob)
18053
0c2f0048125d rm: drop misleading 'use -f' hint for the rm --after 'not removing' warning
Mads Kiilerich <madski@unity3d.com>
parents: 17862
diff changeset
   281
  not removing test/foo: file still exists (glob)
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
   282
  exit code: 1
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   283
  R test/bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   284
  ./foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   285
  ./test/foo
28606
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
   286
  \r (no-eol) (esc)
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
   287
  updating [===========================================>] 1/1\r (no-eol) (esc)
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
   288
                                                              \r (no-eol) (esc)
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   289
  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
   290
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   291
dir, options -Af
9572
1f665246dab3 windows: fix unlink() not dropping empty tree (issue1861)
Patrick Mezard <pmezard@gmail.com>
parents: 6358
diff changeset
   292
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   293
  $ rm test/bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   294
  $ remove -Af test
15447
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 15115
diff changeset
   295
  removing test/bar (glob)
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 15115
diff changeset
   296
  removing test/foo (glob)
12130
48735ce02345 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12129 12099
diff changeset
   297
  exit code: 0
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   298
  R test/bar
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   299
  R test/foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   300
  ./foo
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   301
  ./test/foo
28606
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
   302
  \r (no-eol) (esc)
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
   303
  updating [===========================================>] 2/2\r (no-eol) (esc)
8cc51c5a9365 tests: include progress for test-remove
timeless <timeless@mozdev.org>
parents: 19381
diff changeset
   304
                                                              \r (no-eol) (esc)
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   305
  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
   306
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   307
test remove dropping empty trees (issue1861)
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   308
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   309
  $ mkdir -p issue1861/b/c
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   310
  $ echo x > issue1861/x
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   311
  $ echo y > issue1861/b/c/y
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   312
  $ hg ci -Am add
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   313
  adding issue1861/b/c/y
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   314
  adding issue1861/x
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   315
  $ hg rm issue1861/b
15447
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 15115
diff changeset
   316
  removing issue1861/b/c/y (glob)
12099
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   317
  $ hg ci -m remove
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   318
  $ ls issue1861
54c9549ccb22 tests: unify test-remove
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 9572
diff changeset
   319
  x
16904
9d0f988364bd test-remove-new: integrate into test-remove.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 15447
diff changeset
   320
9d0f988364bd test-remove-new: integrate into test-remove.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 15447
diff changeset
   321
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
   322
9d0f988364bd test-remove-new: integrate into test-remove.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 15447
diff changeset
   323
  $ touch f1
9d0f988364bd test-remove-new: integrate into test-remove.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 15447
diff changeset
   324
  $ hg add f1
9d0f988364bd test-remove-new: integrate into test-remove.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 15447
diff changeset
   325
  $ rm f1
9d0f988364bd test-remove-new: integrate into test-remove.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 15447
diff changeset
   326
  $ hg ci -A -mx
9d0f988364bd test-remove-new: integrate into test-remove.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 15447
diff changeset
   327
  removing f1
9d0f988364bd test-remove-new: integrate into test-remove.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 15447
diff changeset
   328
  nothing changed
9d0f988364bd test-remove-new: integrate into test-remove.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 15447
diff changeset
   329
  [1]
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 16904
diff changeset
   330
17848
66f0c78350ab remove: don't return error on directories with tracked files
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
   331
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
   332
66f0c78350ab remove: don't return error on directories with tracked files
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
   333
  $ mkdir d1
66f0c78350ab remove: don't return error on directories with tracked files
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
   334
  $ echo a > d1/a
66f0c78350ab remove: don't return error on directories with tracked files
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
   335
  $ hg rm --after d1
66f0c78350ab remove: don't return error on directories with tracked files
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
   336
  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
   337
  [1]
66f0c78350ab remove: don't return error on directories with tracked files
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
   338
  $ hg add d1/a
66f0c78350ab remove: don't return error on directories with tracked files
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
   339
  $ rm d1/a
66f0c78350ab remove: don't return error on directories with tracked files
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
   340
  $ hg rm --after d1
17861
3125af2d99d2 test-remove: fix \ vs. / issues on Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 17848
diff changeset
   341
  removing d1/a (glob)
17862
2142691be14f test-remove: adapt to differing error message on Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 17861
diff changeset
   342
#if windows
2142691be14f test-remove: adapt to differing error message on Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 17861
diff changeset
   343
  $ hg rm --after nosuch
2142691be14f test-remove: adapt to differing error message on Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 17861
diff changeset
   344
  nosuch: * (glob)
2142691be14f test-remove: adapt to differing error message on Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 17861
diff changeset
   345
  [1]
2142691be14f test-remove: adapt to differing error message on Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 17861
diff changeset
   346
#else
17848
66f0c78350ab remove: don't return error on directories with tracked files
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
   347
  $ hg rm --after nosuch
66f0c78350ab remove: don't return error on directories with tracked files
Matt Mackall <mpm@selenic.com>
parents: 16913
diff changeset
   348
  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
   349
  [1]
17862
2142691be14f test-remove: adapt to differing error message on Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 17861
diff changeset
   350
#endif