tests/test-merge-types.t
author Erik Zielke <ez@aragost.com>
Wed, 09 Feb 2011 10:53:09 +0100
changeset 13417 0748e18be470
parent 12279 28e2e3804f2e
child 15441 e0348815e806
permissions -rw-r--r--
subrepos: prompt on conflicts on update with dirty subrepos Consider a repository with a single subrepository. The changesets in the main repository reference the subrepository changesets like this: m0 -> s0 m1 -> s1 m2 -> s2 Starting from a state (m1, s0), doing 'hg update m2' in the main repository will yield a conflict: the subrepo is at revision s0 but the target revision says it should be at revision s2. Before this change, Mercurial would do (m1, s0) -> (m2, s2) and thus ignore the conflict between the working copy and the target revision. With this change, the user is prompted to resolve the conflict by choosing which revision he wants. This is consistent with 'hg merge', which also prompts the user when it detects conflicts in the merged .hgsubstate files. The prompt looks like this: $ hg update tip subrepository sources for my-subrepo differ use (l)ocal source (fc627a69481f) or (r)emote source (12a213df6fa9)?
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
     1
  $ hg init
5503
6f26c7677463 Test a merge of a symlink against an executable file.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
     2
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
     3
  $ echo a > a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
     4
  $ hg ci -Amadd
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
     5
  adding a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
     6
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
     7
  $ chmod +x a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
     8
  $ hg ci -mexecutable
5503
6f26c7677463 Test a merge of a symlink against an executable file.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
     9
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    10
  $ hg up 0
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    11
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    12
  $ rm a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    13
  $ ln -s symlink a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    14
  $ hg ci -msymlink
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    15
  created new head
5503
6f26c7677463 Test a merge of a symlink against an executable file.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    16
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    17
  $ hg merge --debug
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    18
    searching for copies back to rev 1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    19
  resolving manifests
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    20
   overwrite None partial False
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    21
   ancestor c334dc3be0da local 521a1e40188f+ remote 3574f3e69b1c
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    22
   conflicting flags for a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    23
  (n)one, e(x)ec or sym(l)ink? n
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    24
   a: update permissions -> e
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    25
  updating: a 1/1 files (100.00%)
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    26
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    27
  (branch merge, don't forget to commit)
5503
6f26c7677463 Test a merge of a symlink against an executable file.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    28
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    29
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    30
Symlink is local parent, executable is other:
5503
6f26c7677463 Test a merge of a symlink against an executable file.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    31
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    32
  $ if [ -h a ]; then
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    33
  >     echo a is a symlink
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    34
  >     $TESTDIR/readlink.py a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    35
  > elif [ -x a ]; then
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    36
  >     echo a is executable
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    37
  > else
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    38
  >     echo "a has no flags (default for conflicts)"
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    39
  > fi
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    40
  a has no flags (default for conflicts)
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    41
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    42
  $ hg update -C 1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    43
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
5503
6f26c7677463 Test a merge of a symlink against an executable file.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    44
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    45
  $ hg merge --debug
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    46
    searching for copies back to rev 1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    47
  resolving manifests
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    48
   overwrite None partial False
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    49
   ancestor c334dc3be0da local 3574f3e69b1c+ remote 521a1e40188f
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    50
   conflicting flags for a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    51
  (n)one, e(x)ec or sym(l)ink? n
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    52
   a: remote is newer -> g
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    53
  updating: a 1/1 files (100.00%)
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    54
  getting a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    55
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    56
  (branch merge, don't forget to commit)
5503
6f26c7677463 Test a merge of a symlink against an executable file.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    57
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    58
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    59
Symlink is other parent, executable is local:
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    60
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    61
  $ if [ -h a ]; then
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    62
  >    echo a is a symlink
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    63
  >    $TESTDIR/readlink.py a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    64
  > elif [ -x a ]; then
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    65
  >     echo a is executable
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    66
  > else
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    67
  >     echo "a has no flags (default for conflicts)"
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    68
  > fi
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    69
  a has no flags (default for conflicts)
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    70