tests/test-pathconflicts-update.t
author Mark Thomas <mbthomas@fb.com>
Mon, 02 Oct 2017 14:05:30 -0700
changeset 34557 3b9428f4403d
child 34572 d6d10771950c
permissions -rw-r--r--
tests: add test for path conflicts during update Differential Revision: https://phab.mercurial-scm.org/D786
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
34557
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
     1
  $ hg init repo
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
     2
  $ cd repo
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
     3
  $ echo base > base
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
     4
  $ hg add base
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
     5
  $ hg commit -m "base"
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
     6
  $ hg bookmark -i base
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
     7
  $ mkdir a
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
     8
  $ echo 1 > a/b
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
     9
  $ hg add a/b
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    10
  $ hg commit -m "file"
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    11
  $ hg bookmark -i file
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    12
  $ echo 2 > a/b
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    13
  $ hg commit -m "file2"
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    14
  $ hg bookmark -i file2
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    15
  $ hg up 0
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    16
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    17
  $ mkdir a
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    18
  $ ln -s c a/b
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    19
  $ hg add a/b
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    20
  $ hg commit -m "link"
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    21
  created new head
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    22
  $ hg bookmark -i link
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    23
  $ hg up 0
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    24
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    25
  $ mkdir -p a/b/c
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    26
  $ echo 2 > a/b/c/d
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    27
  $ hg add a/b/c/d
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    28
  $ hg commit -m "dir"
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    29
  created new head
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    30
  $ hg bookmark -i dir
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    31
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    32
Update - local file conflicts with remote directory:
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    33
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    34
  $ hg up -q 0
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    35
  $ mkdir a
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    36
  $ echo 9 > a/b
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    37
  $ hg up dir
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    38
  a/b: untracked file conflicts with directory
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    39
  abort: untracked files in working directory differ from files in requested revision
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    40
  [255]
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    41
  $ hg up dir --config merge.checkunknown=warn
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    42
  a/b: replacing untracked file
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    43
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    44
  (activating bookmark dir)
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    45
  $ cat a/b.orig
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    46
  9
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    47
  $ rm a/b.orig
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    48
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    49
Update - local symlink conflicts with remote directory:
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    50
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    51
  $ hg up -q 0
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    52
  $ mkdir a
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    53
  $ ln -s x a/b
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    54
  $ hg up dir
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    55
  a/b: untracked file conflicts with directory
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    56
  abort: untracked files in working directory differ from files in requested revision
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    57
  [255]
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    58
  $ hg up dir --config merge.checkunknown=warn
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    59
  a/b: replacing untracked file
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    60
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    61
  (activating bookmark dir)
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    62
  $ readlink a/b.orig
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    63
  x
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    64
  $ rm a/b.orig
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    65
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    66
Update - local directory conflicts with remote file
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    67
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    68
  $ hg up -q 0
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    69
  $ mkdir -p a/b/c
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    70
  $ echo 9 > a/b/c/d
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    71
  $ hg up file
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    72
  a/b: untracked directory conflicts with file
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    73
  abort: untracked files in working directory differ from files in requested revision
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    74
  [255]
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    75
  $ hg up file --config merge.checkunknown=warn
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    76
  a/b: replacing untracked files in directory
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    77
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    78
  (activating bookmark file)
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    79
  $ cat a/b
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    80
  1
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    81
  $ test -d a/b.orig
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    82
  $ rm -rf a/b.orig
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    83
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    84
Update - local directory conflicts with remote symlink
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    85
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    86
  $ hg up -q 0
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    87
  $ mkdir -p a/b/c
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    88
  $ echo 9 > a/b/c/d
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    89
  $ hg up link
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    90
  a/b: untracked directory conflicts with file
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    91
  abort: untracked files in working directory differ from files in requested revision
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    92
  [255]
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    93
  $ hg up link --config merge.checkunknown=warn
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    94
  a/b: replacing untracked files in directory
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    95
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    96
  (activating bookmark link)
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    97
  $ readlink a/b
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    98
  c
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
    99
  $ test -d a/b.orig
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   100
  $ rm -rf a/b.orig
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   101
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   102
Update - local renamed file conflicts with remote directory
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   103
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   104
  $ hg up -q 0
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   105
  $ hg mv base a
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   106
  $ hg status -C
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   107
  A a
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   108
    base
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   109
  R base
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   110
  $ hg up --check dir
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   111
  abort: uncommitted changes
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   112
  [255]
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   113
  $ hg up dir
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   114
  a: path conflict - a file or link has the same name as a directory
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   115
  the local file has been renamed to a~d20a80d4def3
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   116
  resolve manually then use 'hg resolve --mark a'
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   117
  1 files updated, 0 files merged, 0 files removed, 1 files unresolved
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   118
  use 'hg resolve' to retry unresolved file merges
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   119
  (activating bookmark dir)
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   120
  [1]
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   121
  $ hg status -C
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   122
  A a~d20a80d4def3
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   123
    base
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   124
  R base
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   125
  $ hg resolve --list
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   126
  P a
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   127
  $ hg up --clean -q 0
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   128
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   129
Update clean - local directory conflicts with changed remote file
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   130
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   131
  $ hg up -q file
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   132
  $ rm a/b
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   133
  $ mkdir a/b
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   134
  $ echo 9 > a/b/c
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   135
  $ hg up file2 --check --config merge.checkunknown=warn
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   136
  abort: uncommitted changes
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   137
  [255]
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   138
  $ hg up file2 --clean
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   139
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   140
  (activating bookmark file2)
3b9428f4403d tests: add test for path conflicts during update
Mark Thomas <mbthomas@fb.com>
parents:
diff changeset
   141