tests/test-merge5.t
author Jun Wu <quark@fb.com>
Wed, 30 Nov 2016 19:25:18 +0000
changeset 30556 c059286a0f9c
parent 28065 6b1fc09c699a
child 45840 527ce85c2e60
permissions -rw-r--r--
tests: replace "cp -r" with "cp -R" The POSIX documentation about "cp" [1] says: .... RATIONALE .... Earlier versions of this standard included support for the -r option to copy file hierarchies. The -r option is historical practice on BSD and BSD-derived systems. This option is no longer specified by POSIX.1-2008 but may be present in some implementations. The -R option was added as a close synonym to the -r option, selected for consistency with all other options in this volume of POSIX.1-2008 that do recursive directory descent. The difference between -R and the removed -r option is in the treatment by cp of file types other than regular and directory. It was implementation-defined how the - option treated special files to allow both historical implementations and those that chose to support -r with the same abilities as -R defined by this volume of POSIX.1-2008. The original -r flag, for historic reasons, did not handle special files any differently from regular files, but always read the file and copied its contents. This had obvious problems in the presence of special file types; for example, character devices, FIFOs, and sockets. .... .... Issue 6 The -r option is marked obsolescent. .... Issue 7 .... The obsolescent -r option is removed. .... (No "Issue 8" yet) Therefore it's clear that "cp -R" is strictly better than "cp -r". The issue was discovered when running tests on OS X after 0d87b1caed92. [1]: pubs.opengroup.org/onlinepubs/9699919799/utilities/cp.html
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11978
ef4a1ffbf519 tests: unify test-merge5
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 6350
diff changeset
     1
  $ hg init
ef4a1ffbf519 tests: unify test-merge5
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 6350
diff changeset
     2
  $ echo This is file a1 > a
ef4a1ffbf519 tests: unify test-merge5
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 6350
diff changeset
     3
  $ echo This is file b1 > b
ef4a1ffbf519 tests: unify test-merge5
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 6350
diff changeset
     4
  $ hg add a b
12155
94ad12aa0530 test-merge5: removed unnecessary parts of test
Martin Geisler <mg@lazybytes.net>
parents: 12154
diff changeset
     5
  $ hg commit -m "commit #0"
11978
ef4a1ffbf519 tests: unify test-merge5
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 6350
diff changeset
     6
  $ echo This is file b22 > b
12155
94ad12aa0530 test-merge5: removed unnecessary parts of test
Martin Geisler <mg@lazybytes.net>
parents: 12154
diff changeset
     7
  $ hg commit -m "comment #1"
11978
ef4a1ffbf519 tests: unify test-merge5
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 6350
diff changeset
     8
  $ hg update 0
ef4a1ffbf519 tests: unify test-merge5
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 6350
diff changeset
     9
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
ef4a1ffbf519 tests: unify test-merge5
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 6350
diff changeset
    10
  $ rm b
12155
94ad12aa0530 test-merge5: removed unnecessary parts of test
Martin Geisler <mg@lazybytes.net>
parents: 12154
diff changeset
    11
  $ hg commit -A -m "comment #2"
11978
ef4a1ffbf519 tests: unify test-merge5
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 6350
diff changeset
    12
  removing b
ef4a1ffbf519 tests: unify test-merge5
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 6350
diff changeset
    13
  created new head
12154
c85e07a2d783 test-merge5: ensure updating to tip across branches is tested
Brodie Rao <brodie@bitheap.org>
parents: 11978
diff changeset
    14
  $ hg update 1
c85e07a2d783 test-merge5: ensure updating to tip across branches is tested
Brodie Rao <brodie@bitheap.org>
parents: 11978
diff changeset
    15
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
17849
6da47b655d97 update: check for missing files with --check (issue3595)
Matt Mackall <mpm@selenic.com>
parents: 14485
diff changeset
    16
  $ rm b
28065
6b1fc09c699a update: change default destination to tipmost descendant (issue4673) (BC)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 28029
diff changeset
    17
  $ hg update -c 2
19801
41abe2e3e3b7 update: standardize error message for dirty update --check
Siddharth Agarwal <sid0@fb.com>
parents: 19799
diff changeset
    18
  abort: uncommitted changes
17849
6da47b655d97 update: check for missing files with --check (issue3595)
Matt Mackall <mpm@selenic.com>
parents: 14485
diff changeset
    19
  [255]
6da47b655d97 update: check for missing files with --check (issue3595)
Matt Mackall <mpm@selenic.com>
parents: 14485
diff changeset
    20
  $ hg revert b
28065
6b1fc09c699a update: change default destination to tipmost descendant (issue4673) (BC)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 28029
diff changeset
    21
  $ hg update -c 2
12154
c85e07a2d783 test-merge5: ensure updating to tip across branches is tested
Brodie Rao <brodie@bitheap.org>
parents: 11978
diff changeset
    22
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
11978
ef4a1ffbf519 tests: unify test-merge5
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 6350
diff changeset
    23
  $ mv a c
415
c2b9502a4e96 [PATCH] Don't prompt user for keep-vs-delete when the merge is about to be aborted
mpm@selenic.com
parents:
diff changeset
    24
12155
94ad12aa0530 test-merge5: removed unnecessary parts of test
Martin Geisler <mg@lazybytes.net>
parents: 12154
diff changeset
    25
Should abort:
94ad12aa0530 test-merge5: removed unnecessary parts of test
Martin Geisler <mg@lazybytes.net>
parents: 12154
diff changeset
    26
23026
fe80fdf68ba7 test-merge5: remove obsolete '-y' and its motivating comment
Martin von Zweigbergk <martinvonz@gmail.com>
parents: 19801
diff changeset
    27
  $ hg update 1
19799
ab3e42225dbc update: add error message for dirty non-linear update with no rev
Siddharth Agarwal <sid0@fb.com>
parents: 19798
diff changeset
    28
  abort: uncommitted changes
ab3e42225dbc update: add error message for dirty non-linear update with no rev
Siddharth Agarwal <sid0@fb.com>
parents: 19798
diff changeset
    29
  (commit or update --clean to discard changes)
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12155
diff changeset
    30
  [255]
11978
ef4a1ffbf519 tests: unify test-merge5
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 6350
diff changeset
    31
  $ mv c a
12155
94ad12aa0530 test-merge5: removed unnecessary parts of test
Martin Geisler <mg@lazybytes.net>
parents: 12154
diff changeset
    32
94ad12aa0530 test-merge5: removed unnecessary parts of test
Martin Geisler <mg@lazybytes.net>
parents: 12154
diff changeset
    33
Should succeed:
94ad12aa0530 test-merge5: removed unnecessary parts of test
Martin Geisler <mg@lazybytes.net>
parents: 12154
diff changeset
    34
23026
fe80fdf68ba7 test-merge5: remove obsolete '-y' and its motivating comment
Martin von Zweigbergk <martinvonz@gmail.com>
parents: 19801
diff changeset
    35
  $ hg update 1
11978
ef4a1ffbf519 tests: unify test-merge5
Pradeepkumar Gayam <in3xes@gmail.com>
parents: 6350
diff changeset
    36
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved