tests/test-rename-dir-merge.t
author Nicolas Dumazet <nicdumz.commits@gmail.com>
Mon, 30 Aug 2010 13:51:27 +0900
changeset 12113 d171000cf6f8
parent 12112 d27d5ae576a2
permissions -rw-r--r--
tests: unify test-rename-dir-merge2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12112
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
     1
  $ mkdir t
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
     2
  $ cd t
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
     3
  $ hg init
3733
9e67fecbfd16 merge: handle directory renames
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     4
12112
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
     5
  $ mkdir a
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
     6
  $ echo foo > a/a
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
     7
  $ echo bar > a/b
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
     8
  $ hg ci -Am "0"
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
     9
  adding a/a
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    10
  adding a/b
3733
9e67fecbfd16 merge: handle directory renames
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    11
12112
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    12
  $ hg co -C 0
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    13
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    14
  $ hg mv a b
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    15
  moving a/a to b/a
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    16
  moving a/b to b/b
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    17
  $ hg ci -m "1 mv a/ b/"
3733
9e67fecbfd16 merge: handle directory renames
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    18
12112
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    19
  $ hg co -C 0
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    20
  2 files updated, 0 files merged, 2 files removed, 0 files unresolved
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    21
  $ echo baz > a/c
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    22
  $ echo quux > a/d
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    23
  $ hg add a/c
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    24
  $ hg ci -m "2 add a/c"
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    25
  created new head
3733
9e67fecbfd16 merge: handle directory renames
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    26
12112
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    27
  $ hg merge --debug 1
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    28
    searching for copies back to rev 1
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    29
    unmatched files in local:
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    30
     a/c
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    31
     a/d
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    32
    unmatched files in other:
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    33
     b/a
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    34
     b/b
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    35
    all copies found (* = to merge, ! = divergent):
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    36
     b/a -> a/a 
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    37
     b/b -> a/b 
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    38
    checking for directory renames
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    39
    dir a/ -> b/
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    40
    file a/c -> b/c
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    41
    file a/d -> b/d
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    42
  resolving manifests
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    43
   overwrite None partial False
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    44
   ancestor f9b20c0d4c51 local ce36d17b18fb+ remote 397f8b00a740
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    45
   a/d: remote renamed directory to b/d -> d
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    46
   a/c: remote renamed directory to b/c -> d
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    47
   a/b: other deleted -> r
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    48
   a/a: other deleted -> r
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    49
   b/a: remote created -> g
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    50
   b/b: remote created -> g
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    51
  updating: a/a 1/6 files (16.67%)
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    52
  removing a/a
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    53
  updating: a/b 2/6 files (33.33%)
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    54
  removing a/b
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    55
  updating: a/c 3/6 files (50.00%)
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    56
  moving a/c to b/c
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    57
  updating: a/d 4/6 files (66.67%)
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    58
  moving a/d to b/d
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    59
  updating: b/a 5/6 files (83.33%)
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    60
  getting b/a
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    61
  updating: b/b 6/6 files (100.00%)
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    62
  getting b/b
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    63
  4 files updated, 0 files merged, 2 files removed, 0 files unresolved
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    64
  (branch merge, don't forget to commit)
3733
9e67fecbfd16 merge: handle directory renames
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    65
12112
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    66
  $ echo a/* b/*
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    67
  a/* b/a b/b b/c b/d
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    68
  $ hg st -C
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    69
  M b/a
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    70
  M b/b
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    71
  A b/c
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    72
    a/c
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    73
  R a/a
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    74
  R a/b
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    75
  R a/c
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    76
  ? b/d
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    77
  $ hg ci -m "3 merge 2+1"
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    78
  $ hg debugrename b/c
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    79
  b/c renamed from a/c:354ae8da6e890359ef49ade27b68bbc361f3ca88
3733
9e67fecbfd16 merge: handle directory renames
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    80
12112
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    81
  $ hg co -C 1
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    82
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    83
  $ hg merge --debug 2
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    84
    searching for copies back to rev 1
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    85
    unmatched files in local:
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    86
     b/a
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    87
     b/b
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    88
     b/d
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    89
    unmatched files in other:
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    90
     a/c
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    91
    all copies found (* = to merge, ! = divergent):
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    92
     b/a -> a/a 
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    93
     b/b -> a/b 
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    94
    checking for directory renames
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    95
    dir a/ -> b/
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    96
    file a/c -> b/c
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    97
  resolving manifests
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    98
   overwrite None partial False
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    99
   ancestor f9b20c0d4c51 local 397f8b00a740+ remote ce36d17b18fb
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
   100
   None: local renamed directory to b/c -> d
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
   101
  updating:None 1/1 files (100.00%)
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
   102
  getting a/c to b/c
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
   103
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
   104
  (branch merge, don't forget to commit)
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
   105
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
   106
  $ echo a/* b/*
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
   107
  a/* b/a b/b b/c b/d
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
   108
  $ hg st -C
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
   109
  A b/c
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
   110
    a/c
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
   111
  ? b/d
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
   112
  $ hg ci -m "4 merge 1+2"
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
   113
  created new head
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
   114
  $ hg debugrename b/c
d27d5ae576a2 tests: unify test-rename-dir-merge
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
   115
  b/c renamed from a/c:354ae8da6e890359ef49ade27b68bbc361f3ca88