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