tests/test-addremove.t
author Adrian Buehlmann <adrian@cadifra.com>
Tue, 19 Apr 2011 12:42:53 +0200
changeset 13962 8b252e826c68
parent 12156 4c94b6d0fb1c
child 15444 e1f05d7a8c7b
permissions -rw-r--r--
add: introduce a warning message for non-portable filenames (issue2756) (BC) On POSIX platforms, the 'add', 'addremove', 'copy' and 'rename' commands now warn if a file has a name that can't be checked out on Windows. Example: $ hg add con.xml warning: filename contains 'con', which is reserved on Windows: 'con.xml' $ hg status A con.xml The file is added despite the warning. The warning is ON by default. It can be suppressed by setting the config option 'portablefilenames' in section 'ui' to 'ignore' or 'false': $ hg --config ui.portablefilenames=ignore add con.xml $ hg sta A con.xml If ui.portablefilenames is set to 'abort', then the command is aborted: $ hg --config ui.portablefilenames=abort add con.xml abort: filename contains 'con', which is reserved on Windows: 'con.xml' On Windows, the ui.portablefilenames config setting is irrelevant and the command is always aborted if a problematic filename is found.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11850
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
     1
  $ hg init rep
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
     2
  $ cd rep
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
     3
  $ mkdir dir
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
     4
  $ touch foo dir/bar
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
     5
  $ hg -v addremove
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
     6
  adding dir/bar
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
     7
  adding foo
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11850
diff changeset
     8
  $ hg -v commit -m "add 1"
11850
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
     9
  dir/bar
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
    10
  foo
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11850
diff changeset
    11
  committed changeset 0:6f7f953567a2
11850
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
    12
  $ cd dir/
13962
8b252e826c68 add: introduce a warning message for non-portable filenames (issue2756) (BC)
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    13
  $ touch ../foo_2 bar_2 con.xml
11850
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
    14
  $ hg -v addremove
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
    15
  adding dir/bar_2
13962
8b252e826c68 add: introduce a warning message for non-portable filenames (issue2756) (BC)
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    16
  adding dir/con.xml
11850
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
    17
  adding foo_2
13962
8b252e826c68 add: introduce a warning message for non-portable filenames (issue2756) (BC)
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    18
  warning: filename contains 'con', which is reserved on Windows: 'dir/con.xml'
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11850
diff changeset
    19
  $ hg -v commit -m "add 2"
11850
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
    20
  dir/bar_2
13962
8b252e826c68 add: introduce a warning message for non-portable filenames (issue2756) (BC)
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    21
  dir/con.xml
11850
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
    22
  foo_2
13962
8b252e826c68 add: introduce a warning message for non-portable filenames (issue2756) (BC)
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    23
  committed changeset 1:6bb597da00f1
2958
ff3ea21a981a addremove: add -s/--similarity option
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 1933
diff changeset
    24
11850
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
    25
  $ cd ..
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
    26
  $ hg init sim
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
    27
  $ cd sim
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
    28
  $ echo a > a
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
    29
  $ echo a >> a
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
    30
  $ echo a >> a
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
    31
  $ echo c > c
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
    32
  $ hg commit -Ama
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
    33
  adding a
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
    34
  adding c
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
    35
  $ mv a b
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
    36
  $ rm c
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
    37
  $ echo d > d
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
    38
  $ hg addremove -n -s 50 # issue 1696
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
    39
  removing a
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
    40
  adding b
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
    41
  removing c
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
    42
  adding d
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
    43
  recording removal of a as rename to b (100% similar)
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
    44
  $ hg addremove -s 50
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
    45
  removing a
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
    46
  adding b
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
    47
  removing c
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
    48
  adding d
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
    49
  recording removal of a as rename to b (100% similar)
54dbf16b401f tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents: 8990
diff changeset
    50
  $ hg commit -mb