tests/test-copies.t
author Martin von Zweigbergk <martinvonz@google.com>
Tue, 19 Feb 2019 10:45:22 -0800
changeset 41753 3158cb74fbca
parent 41751 4ec0ce0fb929
child 41754 d5edb5d3a337
permissions -rw-r--r--
copies: make _backwardrenames() filter out copies by destination As shown by the test case, _backwardrenames() doesn't filter by the matcher. It doesn't show up in `hg status --copies` because that only prints files changed between the two commits. I wouldn't be surprised if some other command that replies on pathcopies() was broken before this patch, but I haven't bothered to check other commands. Differential Revision: https://phab.mercurial-scm.org/D5988
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
     1
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
     2
  $ cat >> $HGRCPATH << EOF
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
     3
  > [alias]
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
     4
  > l = log -G -T '{rev} {desc}\n{files}\n'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
     5
  > EOF
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
     6
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
     7
  $ REPONUM=0
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
     8
  $ newrepo() {
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
     9
  >     cd $TESTTMP
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    10
  >     REPONUM=`expr $REPONUM + 1`
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    11
  >     hg init repo-$REPONUM
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    12
  >     cd repo-$REPONUM
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    13
  > }
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    14
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    15
Simple rename case
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    16
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    17
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    18
  $ hg ci -Aqm 'add x'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    19
  $ hg mv x y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    20
  $ hg ci -m 'rename x to y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    21
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    22
  @  1 rename x to y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    23
  |  x y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    24
  o  0 add x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    25
     x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    26
  $ hg debugpathcopies 0 1
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    27
  x -> y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    28
  $ hg debugpathcopies 1 0
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    29
  y -> x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    30
Test filtering copies by path. We do filtering by destination.
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    31
  $ hg debugpathcopies 0 1 x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    32
  $ hg debugpathcopies 1 0 x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    33
  y -> x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    34
  $ hg debugpathcopies 0 1 y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    35
  x -> y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    36
  $ hg debugpathcopies 1 0 y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    37
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    38
Copy a file onto another file
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    39
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    40
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    41
  $ echo y > y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    42
  $ hg ci -Aqm 'add x and y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    43
  $ hg cp -f x y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    44
  $ hg ci -m 'copy x onto y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    45
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    46
  @  1 copy x onto y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    47
  |  y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    48
  o  0 add x and y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    49
     x y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    50
Incorrectly doesn't show the rename
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    51
  $ hg debugpathcopies 0 1
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    52
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    53
Copy a file onto another file with same content. If metadata is stored in changeset, this does not
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    54
produce a new filelog entry. The changeset's "files" entry should still list the file.
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    55
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    56
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    57
  $ echo x > x2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    58
  $ hg ci -Aqm 'add x and x2 with same content'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    59
  $ hg cp -f x x2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    60
  $ hg ci -m 'copy x onto x2'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    61
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    62
  @  1 copy x onto x2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    63
  |  x2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    64
  o  0 add x and x2 with same content
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    65
     x x2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    66
Incorrectly doesn't show the rename
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    67
  $ hg debugpathcopies 0 1
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    68
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    69
Copy a file, then delete destination, then copy again. This does not create a new filelog entry.
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    70
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    71
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    72
  $ hg ci -Aqm 'add x'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    73
  $ hg cp x y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    74
  $ hg ci -m 'copy x to y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    75
  $ hg rm y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    76
  $ hg ci -m 'remove y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    77
  $ hg cp -f x y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    78
  $ hg ci -m 'copy x onto y (again)'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    79
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    80
  @  3 copy x onto y (again)
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    81
  |  y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    82
  o  2 remove y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    83
  |  y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    84
  o  1 copy x to y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    85
  |  y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    86
  o  0 add x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    87
     x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    88
  $ hg debugpathcopies 0 3
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    89
  x -> y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    90
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    91
Rename file in a loop: x->y->z->x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    92
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    93
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    94
  $ hg ci -Aqm 'add x'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    95
  $ hg mv x y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    96
  $ hg ci -m 'rename x to y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    97
  $ hg mv y z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    98
  $ hg ci -m 'rename y to z'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    99
  $ hg mv z x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   100
  $ hg ci -m 'rename z to x'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   101
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   102
  @  3 rename z to x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   103
  |  x z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   104
  o  2 rename y to z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   105
  |  y z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   106
  o  1 rename x to y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   107
  |  x y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   108
  o  0 add x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   109
     x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   110
  $ hg debugpathcopies 0 3
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   111
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   112
Copy x to y, then remove y, then add back y. With copy metadata in the changeset, this could easily
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   113
end up reporting y as copied from x (if we don't unmark it as a copy when it's removed).
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   114
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   115
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   116
  $ hg ci -Aqm 'add x'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   117
  $ hg mv x y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   118
  $ hg ci -m 'rename x to y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   119
  $ hg rm y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   120
  $ hg ci -qm 'remove y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   121
  $ echo x > y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   122
  $ hg ci -Aqm 'add back y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   123
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   124
  @  3 add back y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   125
  |  y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   126
  o  2 remove y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   127
  |  y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   128
  o  1 rename x to y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   129
  |  x y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   130
  o  0 add x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   131
     x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   132
  $ hg debugpathcopies 0 3
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   133
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   134
Copy x to z, then remove z, then copy x2 (same content as x) to z. With copy metadata in the
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   135
changeset, the two copies here will have the same filelog entry, so ctx['z'].introrev() might point
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   136
to the first commit that added the file. We should still report the copy as being from x2.
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   137
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   138
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   139
  $ echo x > x2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   140
  $ hg ci -Aqm 'add x and x2 with same content'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   141
  $ hg cp x z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   142
  $ hg ci -qm 'copy x to z'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   143
  $ hg rm z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   144
  $ hg ci -m 'remove z'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   145
  $ hg cp x2 z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   146
  $ hg ci -m 'copy x2 to z'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   147
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   148
  @  3 copy x2 to z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   149
  |  z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   150
  o  2 remove z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   151
  |  z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   152
  o  1 copy x to z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   153
  |  z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   154
  o  0 add x and x2 with same content
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   155
     x x2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   156
  $ hg debugpathcopies 0 3
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   157
  x2 -> z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   158
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   159
Create x and y, then rename them both to the same name, but on different sides of a fork
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   160
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   161
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   162
  $ echo y > y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   163
  $ hg ci -Aqm 'add x and y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   164
  $ hg mv x z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   165
  $ hg ci -qm 'rename x to z'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   166
  $ hg co -q 0
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   167
  $ hg mv y z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   168
  $ hg ci -qm 'rename y to z'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   169
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   170
  @  2 rename y to z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   171
  |  y z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   172
  | o  1 rename x to z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   173
  |/   x z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   174
  o  0 add x and y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   175
     x y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   176
  $ hg debugpathcopies 1 2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   177
  z -> x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   178
  y -> z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   179
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   180
Fork renames x to y on one side and removes x on the other
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   181
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   182
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   183
  $ hg ci -Aqm 'add x'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   184
  $ hg mv x y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   185
  $ hg ci -m 'rename x to y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   186
  $ hg co -q 0
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   187
  $ hg rm x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   188
  $ hg ci -m 'remove x'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   189
  created new head
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   190
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   191
  @  2 remove x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   192
  |  x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   193
  | o  1 rename x to y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   194
  |/   x y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   195
  o  0 add x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   196
     x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   197
BROKEN: x doesn't exist here
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   198
  $ hg debugpathcopies 1 2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   199
  y -> x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   200
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   201
Copies via null revision (there shouldn't be any)
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   202
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   203
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   204
  $ hg ci -Aqm 'add x'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   205
  $ hg cp x y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   206
  $ hg ci -m 'copy x to y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   207
  $ hg co -q null
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   208
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   209
  $ hg ci -Aqm 'add x (again)'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   210
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   211
  @  2 add x (again)
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   212
     x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   213
  o  1 copy x to y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   214
  |  y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   215
  o  0 add x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   216
     x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   217
  $ hg debugpathcopies 1 2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   218
  $ hg debugpathcopies 2 1
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   219
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   220
Merge rename from other branch
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   221
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   222
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   223
  $ hg ci -Aqm 'add x'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   224
  $ hg mv x y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   225
  $ hg ci -m 'rename x to y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   226
  $ hg co -q 0
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   227
  $ echo z > z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   228
  $ hg ci -Aqm 'add z'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   229
  $ hg merge -q 1
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   230
  $ hg ci -m 'merge rename from p2'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   231
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   232
  @    3 merge rename from p2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   233
  |\   x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   234
  | o  2 add z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   235
  | |  z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   236
  o |  1 rename x to y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   237
  |/   x y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   238
  o  0 add x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   239
     x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   240
Perhaps we should indicate the rename here, but `hg status` is documented to be weird during
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   241
merges, so...
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   242
  $ hg debugpathcopies 0 3
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   243
  x -> y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   244
  $ hg debugpathcopies 1 2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   245
  y -> x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   246
  $ hg debugpathcopies 1 3
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   247
  $ hg debugpathcopies 2 3
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   248
  x -> y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   249
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   250
Copy file from either side in a merge
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   251
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   252
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   253
  $ hg ci -Aqm 'add x'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   254
  $ hg co -q null
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   255
  $ echo y > y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   256
  $ hg ci -Aqm 'add y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   257
  $ hg merge -q 0
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   258
  $ hg cp y z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   259
  $ hg ci -m 'copy file from p1 in merge'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   260
  $ hg co -q 1
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   261
  $ hg merge -q 0
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   262
  $ hg cp x z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   263
  $ hg ci -qm 'copy file from p2 in merge'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   264
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   265
  @    3 copy file from p2 in merge
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   266
  |\   z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   267
  +---o  2 copy file from p1 in merge
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   268
  | |/   z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   269
  | o  1 add y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   270
  |    y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   271
  o  0 add x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   272
     x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   273
  $ hg debugpathcopies 1 2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   274
  y -> z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   275
  $ hg debugpathcopies 0 2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   276
  $ hg debugpathcopies 1 3
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   277
  $ hg debugpathcopies 0 3
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   278
  x -> z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   279
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   280
Copy file that exists on both sides of the merge, same content on both sides
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   281
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   282
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   283
  $ hg ci -Aqm 'add x on branch 1'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   284
  $ hg co -q null
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   285
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   286
  $ hg ci -Aqm 'add x on branch 2'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   287
  $ hg merge -q 0
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   288
  $ hg cp x z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   289
  $ hg ci -qm 'merge'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   290
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   291
  @    2 merge
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   292
  |\   z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   293
  | o  1 add x on branch 2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   294
  |    x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   295
  o  0 add x on branch 1
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   296
     x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   297
It's a little weird that it shows up on both sides
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   298
  $ hg debugpathcopies 1 2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   299
  x -> z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   300
  $ hg debugpathcopies 0 2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   301
  x -> z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   302
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   303
Copy file that exists on both sides of the merge, different content
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   304
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   305
  $ echo branch1 > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   306
  $ hg ci -Aqm 'add x on branch 1'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   307
  $ hg co -q null
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   308
  $ echo branch2 > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   309
  $ hg ci -Aqm 'add x on branch 2'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   310
  $ hg merge -q 0
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   311
  warning: conflicts while merging x! (edit, then use 'hg resolve --mark')
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   312
  [1]
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   313
  $ echo resolved > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   314
  $ hg resolve -m x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   315
  (no more unresolved files)
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   316
  $ hg cp x z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   317
  $ hg ci -qm 'merge'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   318
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   319
  @    2 merge
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   320
  |\   x z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   321
  | o  1 add x on branch 2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   322
  |    x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   323
  o  0 add x on branch 1
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   324
     x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   325
  $ hg debugpathcopies 1 2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   326
  $ hg debugpathcopies 0 2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   327
  x -> z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   328
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   329
Copy x->y on one side of merge and copy x->z on the other side. Pathcopies from one parent
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   330
of the merge to the merge should include the copy from the other side.
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   331
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   332
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   333
  $ hg ci -Aqm 'add x'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   334
  $ hg cp x y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   335
  $ hg ci -qm 'copy x to y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   336
  $ hg co -q 0
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   337
  $ hg cp x z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   338
  $ hg ci -qm 'copy x to z'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   339
  $ hg merge -q 1
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   340
  $ hg ci -m 'merge copy x->y and copy x->z'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   341
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   342
  @    3 merge copy x->y and copy x->z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   343
  |\
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   344
  | o  2 copy x to z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   345
  | |  z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   346
  o |  1 copy x to y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   347
  |/   y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   348
  o  0 add x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   349
     x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   350
  $ hg debugpathcopies 2 3
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   351
  x -> y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   352
  $ hg debugpathcopies 1 3
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   353
  x -> z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   354
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   355
Copy x to y on one side of merge, create y and rename to z on the other side. Pathcopies from the
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   356
first side should not include the y->z rename since y didn't exist in the merge base.
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   357
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   358
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   359
  $ hg ci -Aqm 'add x'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   360
  $ hg cp x y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   361
  $ hg ci -qm 'copy x to y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   362
  $ hg co -q 0
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   363
  $ echo y > y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   364
  $ hg ci -Aqm 'add y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   365
  $ hg mv y z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   366
  $ hg ci -m 'rename y to z'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   367
  $ hg merge -q 1
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   368
  $ hg ci -m 'merge'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   369
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   370
  @    4 merge
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   371
  |\
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   372
  | o  3 rename y to z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   373
  | |  y z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   374
  | o  2 add y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   375
  | |  y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   376
  o |  1 copy x to y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   377
  |/   y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   378
  o  0 add x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   379
     x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   380
  $ hg debugpathcopies 2 3
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   381
  y -> z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   382
  $ hg debugpathcopies 1 3
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   383
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   384
Create x and y, then rename x to z on one side of merge, and rename y to z and modify z on the
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   385
other side.
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   386
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   387
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   388
  $ echo y > y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   389
  $ hg ci -Aqm 'add x and y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   390
  $ hg mv x z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   391
  $ hg ci -qm 'rename x to z'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   392
  $ hg co -q 0
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   393
  $ hg mv y z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   394
  $ hg ci -qm 'rename y to z'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   395
  $ echo z >> z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   396
  $ hg ci -m 'modify z'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   397
  $ hg merge -q 1
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   398
  warning: conflicts while merging z! (edit, then use 'hg resolve --mark')
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   399
  [1]
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   400
  $ echo z > z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   401
  $ hg resolve -qm z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   402
  $ hg ci -m 'merge 1 into 3'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   403
Try merging the other direction too
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   404
  $ hg co -q 1
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   405
  $ hg merge -q 3
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   406
  warning: conflicts while merging z! (edit, then use 'hg resolve --mark')
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   407
  [1]
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   408
  $ echo z > z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   409
  $ hg resolve -qm z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   410
  $ hg ci -m 'merge 3 into 1'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   411
  created new head
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   412
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   413
  @    5 merge 3 into 1
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   414
  |\   y z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   415
  +---o  4 merge 1 into 3
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   416
  | |/   x z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   417
  | o  3 modify z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   418
  | |  z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   419
  | o  2 rename y to z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   420
  | |  y z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   421
  o |  1 rename x to z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   422
  |/   x z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   423
  o  0 add x and y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   424
     x y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   425
  $ hg debugpathcopies 1 4
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   426
  $ hg debugpathcopies 2 4
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   427
  $ hg debugpathcopies 0 4
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   428
  x -> z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   429
  $ hg debugpathcopies 1 5
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   430
  $ hg debugpathcopies 2 5
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   431
  $ hg debugpathcopies 0 5
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   432
  x -> z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   433