tests/test-copies.t
author Raphaël Gomès <rgomes@octobus.net>
Tue, 12 Apr 2022 16:24:25 +0200
changeset 49139 7241b3721ba5
parent 46650 2803f94b7431
permissions -rw-r--r--
rust-dirstatemap: stop using `.state` in `is_from_other_parent` This is a deprecated API and will be removed one day. Differential Revision: https://phab.mercurial-scm.org/D12537
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
43139
f78ad4caa5ad sidedatacopies: introduce a sidedata testcase for test-copies.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42645
diff changeset
     1
#testcases filelog compatibility changeset sidedata
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
     2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
     3
  $ cat >> $HGRCPATH << EOF
41931
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
     4
  > [extensions]
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
     5
  > rebase=
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
     6
  > [alias]
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
     7
  > l = log -G -T '{rev} {desc}\n{files}\n'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
     8
  > EOF
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
     9
41756
49ad315b39ee copies: do copy tracing based on ctx.p[12]copies() if configured
Martin von Zweigbergk <martinvonz@google.com>
parents: 41755
diff changeset
    10
#if compatibility
49ad315b39ee copies: do copy tracing based on ctx.p[12]copies() if configured
Martin von Zweigbergk <martinvonz@google.com>
parents: 41755
diff changeset
    11
  $ cat >> $HGRCPATH << EOF
49ad315b39ee copies: do copy tracing based on ctx.p[12]copies() if configured
Martin von Zweigbergk <martinvonz@google.com>
parents: 41755
diff changeset
    12
  > [experimental]
49ad315b39ee copies: do copy tracing based on ctx.p[12]copies() if configured
Martin von Zweigbergk <martinvonz@google.com>
parents: 41755
diff changeset
    13
  > copies.read-from = compatibility
49ad315b39ee copies: do copy tracing based on ctx.p[12]copies() if configured
Martin von Zweigbergk <martinvonz@google.com>
parents: 41755
diff changeset
    14
  > EOF
49ad315b39ee copies: do copy tracing based on ctx.p[12]copies() if configured
Martin von Zweigbergk <martinvonz@google.com>
parents: 41755
diff changeset
    15
#endif
49ad315b39ee copies: do copy tracing based on ctx.p[12]copies() if configured
Martin von Zweigbergk <martinvonz@google.com>
parents: 41755
diff changeset
    16
42142
5382d8f8530b changelog: parse copy metadata if available in extras
Martin von Zweigbergk <martinvonz@google.com>
parents: 41932
diff changeset
    17
#if changeset
5382d8f8530b changelog: parse copy metadata if available in extras
Martin von Zweigbergk <martinvonz@google.com>
parents: 41932
diff changeset
    18
  $ cat >> $HGRCPATH << EOF
5382d8f8530b changelog: parse copy metadata if available in extras
Martin von Zweigbergk <martinvonz@google.com>
parents: 41932
diff changeset
    19
  > [experimental]
5382d8f8530b changelog: parse copy metadata if available in extras
Martin von Zweigbergk <martinvonz@google.com>
parents: 41932
diff changeset
    20
  > copies.read-from = changeset-only
5382d8f8530b changelog: parse copy metadata if available in extras
Martin von Zweigbergk <martinvonz@google.com>
parents: 41932
diff changeset
    21
  > copies.write-to = changeset-only
5382d8f8530b changelog: parse copy metadata if available in extras
Martin von Zweigbergk <martinvonz@google.com>
parents: 41932
diff changeset
    22
  > EOF
5382d8f8530b changelog: parse copy metadata if available in extras
Martin von Zweigbergk <martinvonz@google.com>
parents: 41932
diff changeset
    23
#endif
5382d8f8530b changelog: parse copy metadata if available in extras
Martin von Zweigbergk <martinvonz@google.com>
parents: 41932
diff changeset
    24
43139
f78ad4caa5ad sidedatacopies: introduce a sidedata testcase for test-copies.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42645
diff changeset
    25
#if sidedata
f78ad4caa5ad sidedatacopies: introduce a sidedata testcase for test-copies.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42645
diff changeset
    26
  $ cat >> $HGRCPATH << EOF
f78ad4caa5ad sidedatacopies: introduce a sidedata testcase for test-copies.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42645
diff changeset
    27
  > [format]
f78ad4caa5ad sidedatacopies: introduce a sidedata testcase for test-copies.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42645
diff changeset
    28
  > exp-use-copies-side-data-changeset = yes
f78ad4caa5ad sidedatacopies: introduce a sidedata testcase for test-copies.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42645
diff changeset
    29
  > EOF
f78ad4caa5ad sidedatacopies: introduce a sidedata testcase for test-copies.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42645
diff changeset
    30
#endif
f78ad4caa5ad sidedatacopies: introduce a sidedata testcase for test-copies.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42645
diff changeset
    31
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    32
  $ REPONUM=0
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    33
  $ newrepo() {
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    34
  >     cd $TESTTMP
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    35
  >     REPONUM=`expr $REPONUM + 1`
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    36
  >     hg init repo-$REPONUM
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    37
  >     cd repo-$REPONUM
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    38
  > }
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    39
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    40
Simple rename case
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    41
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    42
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    43
  $ hg ci -Aqm 'add x'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    44
  $ hg mv x y
41755
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
    45
  $ hg debugp1copies
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
    46
  x -> y
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
    47
  $ hg debugp2copies
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    48
  $ hg ci -m 'rename x to y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    49
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    50
  @  1 rename x to y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    51
  |  x y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    52
  o  0 add x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    53
     x
41755
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
    54
  $ hg debugp1copies -r 1
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
    55
  x -> y
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    56
  $ hg debugpathcopies 0 1
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    57
  x -> y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    58
  $ hg debugpathcopies 1 0
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    59
  y -> x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    60
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
    61
  $ hg debugpathcopies 0 1 x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    62
  $ hg debugpathcopies 1 0 x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    63
  y -> x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    64
  $ hg debugpathcopies 0 1 y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    65
  x -> y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    66
  $ hg debugpathcopies 1 0 y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    67
42645
8c5a36805d5d copies: fix crash on in changeset-centric tracing from commit to itself
Martin von Zweigbergk <martinvonz@google.com>
parents: 42621
diff changeset
    68
Copies not including commit changes
8c5a36805d5d copies: fix crash on in changeset-centric tracing from commit to itself
Martin von Zweigbergk <martinvonz@google.com>
parents: 42621
diff changeset
    69
  $ newrepo
8c5a36805d5d copies: fix crash on in changeset-centric tracing from commit to itself
Martin von Zweigbergk <martinvonz@google.com>
parents: 42621
diff changeset
    70
  $ echo x > x
8c5a36805d5d copies: fix crash on in changeset-centric tracing from commit to itself
Martin von Zweigbergk <martinvonz@google.com>
parents: 42621
diff changeset
    71
  $ hg ci -Aqm 'add x'
8c5a36805d5d copies: fix crash on in changeset-centric tracing from commit to itself
Martin von Zweigbergk <martinvonz@google.com>
parents: 42621
diff changeset
    72
  $ hg mv x y
8c5a36805d5d copies: fix crash on in changeset-centric tracing from commit to itself
Martin von Zweigbergk <martinvonz@google.com>
parents: 42621
diff changeset
    73
  $ hg debugpathcopies . .
8c5a36805d5d copies: fix crash on in changeset-centric tracing from commit to itself
Martin von Zweigbergk <martinvonz@google.com>
parents: 42621
diff changeset
    74
  $ hg debugpathcopies . 'wdir()'
8c5a36805d5d copies: fix crash on in changeset-centric tracing from commit to itself
Martin von Zweigbergk <martinvonz@google.com>
parents: 42621
diff changeset
    75
  x -> y
8c5a36805d5d copies: fix crash on in changeset-centric tracing from commit to itself
Martin von Zweigbergk <martinvonz@google.com>
parents: 42621
diff changeset
    76
  $ hg debugpathcopies 'wdir()' .
8c5a36805d5d copies: fix crash on in changeset-centric tracing from commit to itself
Martin von Zweigbergk <martinvonz@google.com>
parents: 42621
diff changeset
    77
  y -> x
8c5a36805d5d copies: fix crash on in changeset-centric tracing from commit to itself
Martin von Zweigbergk <martinvonz@google.com>
parents: 42621
diff changeset
    78
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    79
Copy a file onto another file
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    80
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    81
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    82
  $ echo y > y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    83
  $ hg ci -Aqm 'add x and y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    84
  $ hg cp -f x y
41755
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
    85
  $ hg debugp1copies
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
    86
  x -> y
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
    87
  $ hg debugp2copies
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    88
  $ hg ci -m 'copy x onto y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    89
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    90
  @  1 copy x onto y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    91
  |  y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    92
  o  0 add x and y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    93
     x y
41755
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
    94
  $ hg debugp1copies -r 1
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
    95
  x -> y
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    96
  $ hg debugpathcopies 0 1
46399
1d6d1a15a963 copies: simplify the conditional for _filter's case 3
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45817
diff changeset
    97
  x -> y (no-filelog !)
46408
e948ad0dcbe2 copies: add an devel option to trace all files
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46399
diff changeset
    98
  $ hg debugpathcopies 0 1  --config devel.copy-tracing.trace-all-files=yes
e948ad0dcbe2 copies: add an devel option to trace all files
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46399
diff changeset
    99
  x -> y
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   100
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   101
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
   102
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
   103
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   104
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   105
  $ echo x > x2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   106
  $ 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
   107
  $ hg cp -f x x2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   108
  $ hg ci -m 'copy x onto x2'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   109
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   110
  @  1 copy x onto x2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   111
  |  x2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   112
  o  0 add x and x2 with same content
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   113
     x x2
41755
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
   114
  $ hg debugp1copies -r 1
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
   115
  x -> x2
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   116
  $ hg debugpathcopies 0 1
46399
1d6d1a15a963 copies: simplify the conditional for _filter's case 3
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45817
diff changeset
   117
  x -> x2 (no-filelog !)
46408
e948ad0dcbe2 copies: add an devel option to trace all files
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46399
diff changeset
   118
  $ hg debugpathcopies 0 1  --config devel.copy-tracing.trace-all-files=yes
e948ad0dcbe2 copies: add an devel option to trace all files
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46399
diff changeset
   119
  x -> x2
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   120
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   121
Rename file in a loop: x->y->z->x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   122
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   123
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   124
  $ hg ci -Aqm 'add x'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   125
  $ hg mv x y
41755
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
   126
  $ hg debugp1copies
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
   127
  x -> y
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
   128
  $ hg debugp2copies
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   129
  $ hg ci -m 'rename x to y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   130
  $ hg mv y z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   131
  $ hg ci -m 'rename y to z'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   132
  $ hg mv z x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   133
  $ hg ci -m 'rename z to x'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   134
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   135
  @  3 rename z to x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   136
  |  x z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   137
  o  2 rename y to z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   138
  |  y z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   139
  o  1 rename x to y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   140
  |  x y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   141
  o  0 add x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   142
     x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   143
  $ hg debugpathcopies 0 3
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   144
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   145
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
   146
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
   147
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
   148
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   149
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   150
  $ echo x > x2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   151
  $ 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
   152
  $ hg cp x z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   153
  $ hg ci -qm 'copy x to z'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   154
  $ hg rm z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   155
  $ hg ci -m 'remove z'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   156
  $ hg cp x2 z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   157
  $ hg ci -m 'copy x2 to z'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   158
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   159
  @  3 copy x2 to z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   160
  |  z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   161
  o  2 remove z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   162
  |  z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   163
  o  1 copy x to z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   164
  |  z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   165
  o  0 add x and x2 with same content
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   166
     x x2
41755
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
   167
  $ hg debugp1copies -r 3
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
   168
  x2 -> z
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   169
  $ hg debugpathcopies 0 3
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   170
  x2 -> z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   171
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   172
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
   173
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   174
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   175
  $ echo y > y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   176
  $ hg ci -Aqm 'add x and y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   177
  $ hg mv x z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   178
  $ hg ci -qm 'rename x to z'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   179
  $ hg co -q 0
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   180
  $ hg mv y z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   181
  $ hg ci -qm 'rename y to z'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   182
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   183
  @  2 rename y to z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   184
  |  y z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   185
  | o  1 rename x to z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   186
  |/   x z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   187
  o  0 add x and y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   188
     x y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   189
  $ hg debugpathcopies 1 2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   190
  z -> x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   191
  y -> z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   192
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   193
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
   194
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   195
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   196
  $ hg ci -Aqm 'add x'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   197
  $ hg mv x y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   198
  $ hg ci -m 'rename x to y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   199
  $ hg co -q 0
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   200
  $ hg rm x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   201
  $ hg ci -m 'remove x'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   202
  created new head
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   203
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   204
  @  2 remove x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   205
  |  x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   206
  | o  1 rename x to y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   207
  |/   x y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   208
  o  0 add x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   209
     x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   210
  $ hg debugpathcopies 1 2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   211
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   212
Merge rename from other branch
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   213
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   214
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   215
  $ hg ci -Aqm 'add x'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   216
  $ hg mv x y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   217
  $ hg ci -m 'rename x to y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   218
  $ hg co -q 0
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   219
  $ echo z > z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   220
  $ hg ci -Aqm 'add z'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   221
  $ hg merge -q 1
41755
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
   222
  $ hg debugp1copies
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
   223
  $ hg debugp2copies
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   224
  $ hg ci -m 'merge rename from p2'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   225
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   226
  @    3 merge rename from p2
42621
99ebde4fec99 commit: improve the files field of changelog for merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 42594
diff changeset
   227
  |\
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   228
  | o  2 add z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   229
  | |  z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   230
  o |  1 rename x to y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   231
  |/   x y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   232
  o  0 add x
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
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
   235
merges, so...
41755
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
   236
  $ hg debugp1copies -r 3
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
   237
  $ hg debugp2copies -r 3
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   238
  $ hg debugpathcopies 0 3
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   239
  x -> y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   240
  $ hg debugpathcopies 1 2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   241
  y -> x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   242
  $ hg debugpathcopies 1 3
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   243
  $ hg debugpathcopies 2 3
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   244
  x -> y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   245
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   246
Copy file from either side in a merge
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   247
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   248
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   249
  $ hg ci -Aqm 'add x'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   250
  $ hg co -q null
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   251
  $ echo y > y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   252
  $ hg ci -Aqm 'add y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   253
  $ hg merge -q 0
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   254
  $ hg cp y z
41755
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
   255
  $ hg debugp1copies
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
   256
  y -> z
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
   257
  $ hg debugp2copies
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   258
  $ hg ci -m 'copy file from p1 in merge'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   259
  $ hg co -q 1
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   260
  $ hg merge -q 0
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   261
  $ hg cp x z
41755
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
   262
  $ hg debugp1copies
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
   263
  $ hg debugp2copies
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
   264
  x -> z
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   265
  $ hg ci -qm 'copy file from p2 in merge'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   266
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   267
  @    3 copy file from p2 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  2 copy file from p1 in merge
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   270
  | |/   z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   271
  | o  1 add y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   272
  |    y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   273
  o  0 add x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   274
     x
41755
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
   275
  $ hg debugp1copies -r 2
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
   276
  y -> z
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
   277
  $ hg debugp2copies -r 2
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   278
  $ hg debugpathcopies 1 2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   279
  y -> z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   280
  $ hg debugpathcopies 0 2
41755
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
   281
  $ hg debugp1copies -r 3
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
   282
  $ hg debugp2copies -r 3
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
   283
  x -> z
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   284
  $ hg debugpathcopies 1 3
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   285
  $ hg debugpathcopies 0 3
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   286
  x -> z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   287
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   288
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
   289
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   290
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   291
  $ hg ci -Aqm 'add x on branch 1'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   292
  $ hg co -q null
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   293
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   294
  $ hg ci -Aqm 'add x on branch 2'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   295
  $ hg merge -q 0
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   296
  $ hg cp x z
41755
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
   297
  $ hg debugp1copies
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
   298
  x -> z
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
   299
  $ hg debugp2copies
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   300
  $ hg ci -qm 'merge'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   301
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   302
  @    2 merge
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   303
  |\   z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   304
  | o  1 add x on branch 2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   305
  |    x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   306
  o  0 add x on branch 1
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   307
     x
41755
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
   308
  $ hg debugp1copies -r 2
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
   309
  x -> z
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
   310
  $ hg debugp2copies -r 2
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   311
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
   312
  $ hg debugpathcopies 1 2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   313
  x -> z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   314
  $ hg debugpathcopies 0 2
41756
49ad315b39ee copies: do copy tracing based on ctx.p[12]copies() if configured
Martin von Zweigbergk <martinvonz@google.com>
parents: 41755
diff changeset
   315
  x -> z (filelog !)
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   316
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   317
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
   318
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   319
  $ echo branch1 > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   320
  $ hg ci -Aqm 'add x on branch 1'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   321
  $ hg co -q null
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   322
  $ echo branch2 > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   323
  $ hg ci -Aqm 'add x on branch 2'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   324
  $ hg merge -q 0
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   325
  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
   326
  [1]
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   327
  $ echo resolved > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   328
  $ hg resolve -m x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   329
  (no more unresolved files)
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   330
  $ hg cp x z
41755
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
   331
  $ hg debugp1copies
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
   332
  x -> z
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
   333
  $ hg debugp2copies
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   334
  $ hg ci -qm 'merge'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   335
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   336
  @    2 merge
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   337
  |\   x z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   338
  | o  1 add x on branch 2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   339
  |    x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   340
  o  0 add x on branch 1
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   341
     x
41755
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
   342
  $ hg debugp1copies -r 2
42142
5382d8f8530b changelog: parse copy metadata if available in extras
Martin von Zweigbergk <martinvonz@google.com>
parents: 41932
diff changeset
   343
  x -> z (changeset !)
43146
0171483b082f sidedatacopies: read rename information from sidedata
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 43139
diff changeset
   344
  x -> z (sidedata !)
41755
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
   345
  $ hg debugp2copies -r 2
43146
0171483b082f sidedatacopies: read rename information from sidedata
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 43139
diff changeset
   346
  x -> z (no-changeset no-sidedata !)
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   347
  $ hg debugpathcopies 1 2
42142
5382d8f8530b changelog: parse copy metadata if available in extras
Martin von Zweigbergk <martinvonz@google.com>
parents: 41932
diff changeset
   348
  x -> z (changeset !)
43146
0171483b082f sidedatacopies: read rename information from sidedata
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 43139
diff changeset
   349
  x -> z (sidedata !)
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   350
  $ hg debugpathcopies 0 2
43146
0171483b082f sidedatacopies: read rename information from sidedata
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 43139
diff changeset
   351
  x -> z (no-changeset no-sidedata !)
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   352
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   353
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
   354
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
   355
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   356
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   357
  $ hg ci -Aqm 'add x'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   358
  $ hg cp x y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   359
  $ hg ci -qm 'copy x to y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   360
  $ hg co -q 0
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   361
  $ hg cp x z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   362
  $ hg ci -qm 'copy x to z'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   363
  $ hg merge -q 1
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   364
  $ 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
   365
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   366
  @    3 merge copy x->y and copy x->z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   367
  |\
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   368
  | o  2 copy x to z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   369
  | |  z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   370
  o |  1 copy x to y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   371
  |/   y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   372
  o  0 add x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   373
     x
41755
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
   374
  $ hg debugp1copies -r 3
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
   375
  $ hg debugp2copies -r 3
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   376
  $ hg debugpathcopies 2 3
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   377
  x -> y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   378
  $ hg debugpathcopies 1 3
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   379
  x -> z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   380
46647
86ee73018e62 tests: demonstrate how grafted copies are counted when tracing across branches
Martin von Zweigbergk <martinvonz@google.com>
parents: 46408
diff changeset
   381
Copy x->y on two separate branches. Pathcopies from one branch to the other
86ee73018e62 tests: demonstrate how grafted copies are counted when tracing across branches
Martin von Zweigbergk <martinvonz@google.com>
parents: 46408
diff changeset
   382
should not report the copy.
86ee73018e62 tests: demonstrate how grafted copies are counted when tracing across branches
Martin von Zweigbergk <martinvonz@google.com>
parents: 46408
diff changeset
   383
  $ newrepo
86ee73018e62 tests: demonstrate how grafted copies are counted when tracing across branches
Martin von Zweigbergk <martinvonz@google.com>
parents: 46408
diff changeset
   384
  $ echo x > x
86ee73018e62 tests: demonstrate how grafted copies are counted when tracing across branches
Martin von Zweigbergk <martinvonz@google.com>
parents: 46408
diff changeset
   385
  $ hg ci -Aqm 'add x'
86ee73018e62 tests: demonstrate how grafted copies are counted when tracing across branches
Martin von Zweigbergk <martinvonz@google.com>
parents: 46408
diff changeset
   386
  $ hg cp x y
86ee73018e62 tests: demonstrate how grafted copies are counted when tracing across branches
Martin von Zweigbergk <martinvonz@google.com>
parents: 46408
diff changeset
   387
  $ hg ci -qm 'copy x to y'
86ee73018e62 tests: demonstrate how grafted copies are counted when tracing across branches
Martin von Zweigbergk <martinvonz@google.com>
parents: 46408
diff changeset
   388
  $ hg co -q 0
86ee73018e62 tests: demonstrate how grafted copies are counted when tracing across branches
Martin von Zweigbergk <martinvonz@google.com>
parents: 46408
diff changeset
   389
  $ hg graft 1 -q
86ee73018e62 tests: demonstrate how grafted copies are counted when tracing across branches
Martin von Zweigbergk <martinvonz@google.com>
parents: 46408
diff changeset
   390
  $ hg l
86ee73018e62 tests: demonstrate how grafted copies are counted when tracing across branches
Martin von Zweigbergk <martinvonz@google.com>
parents: 46408
diff changeset
   391
  @  2 copy x to y
86ee73018e62 tests: demonstrate how grafted copies are counted when tracing across branches
Martin von Zweigbergk <martinvonz@google.com>
parents: 46408
diff changeset
   392
  |  y
86ee73018e62 tests: demonstrate how grafted copies are counted when tracing across branches
Martin von Zweigbergk <martinvonz@google.com>
parents: 46408
diff changeset
   393
  | o  1 copy x to y
86ee73018e62 tests: demonstrate how grafted copies are counted when tracing across branches
Martin von Zweigbergk <martinvonz@google.com>
parents: 46408
diff changeset
   394
  |/   y
86ee73018e62 tests: demonstrate how grafted copies are counted when tracing across branches
Martin von Zweigbergk <martinvonz@google.com>
parents: 46408
diff changeset
   395
  o  0 add x
86ee73018e62 tests: demonstrate how grafted copies are counted when tracing across branches
Martin von Zweigbergk <martinvonz@google.com>
parents: 46408
diff changeset
   396
     x
86ee73018e62 tests: demonstrate how grafted copies are counted when tracing across branches
Martin von Zweigbergk <martinvonz@google.com>
parents: 46408
diff changeset
   397
  $ hg debugp1copies -r 1
86ee73018e62 tests: demonstrate how grafted copies are counted when tracing across branches
Martin von Zweigbergk <martinvonz@google.com>
parents: 46408
diff changeset
   398
  x -> y
86ee73018e62 tests: demonstrate how grafted copies are counted when tracing across branches
Martin von Zweigbergk <martinvonz@google.com>
parents: 46408
diff changeset
   399
  $ hg debugp1copies -r 2
86ee73018e62 tests: demonstrate how grafted copies are counted when tracing across branches
Martin von Zweigbergk <martinvonz@google.com>
parents: 46408
diff changeset
   400
  x -> y
86ee73018e62 tests: demonstrate how grafted copies are counted when tracing across branches
Martin von Zweigbergk <martinvonz@google.com>
parents: 46408
diff changeset
   401
  $ hg debugpathcopies 1 2
86ee73018e62 tests: demonstrate how grafted copies are counted when tracing across branches
Martin von Zweigbergk <martinvonz@google.com>
parents: 46408
diff changeset
   402
  $ hg debugpathcopies 2 1
86ee73018e62 tests: demonstrate how grafted copies are counted when tracing across branches
Martin von Zweigbergk <martinvonz@google.com>
parents: 46408
diff changeset
   403
42594
d013099c551b copies: filter invalid copies only at end of pathcopies() (issue6163)
Martin von Zweigbergk <martinvonz@google.com>
parents: 42589
diff changeset
   404
Copy x to y on one side of merge, create y and rename to z on the other side.
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   405
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   406
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   407
  $ hg ci -Aqm 'add x'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   408
  $ hg cp x y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   409
  $ hg ci -qm 'copy x to y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   410
  $ hg co -q 0
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   411
  $ echo y > y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   412
  $ hg ci -Aqm 'add y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   413
  $ hg mv y z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   414
  $ hg ci -m 'rename y to z'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   415
  $ hg merge -q 1
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   416
  $ hg ci -m 'merge'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   417
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   418
  @    4 merge
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   419
  |\
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   420
  | o  3 rename y to z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   421
  | |  y z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   422
  | o  2 add y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   423
  | |  y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   424
  o |  1 copy x to y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   425
  |/   y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   426
  o  0 add x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   427
     x
41755
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
   428
  $ hg debugp1copies -r 3
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
   429
  y -> z
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
   430
  $ hg debugp2copies -r 3
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   431
  $ hg debugpathcopies 2 3
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   432
  y -> z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   433
  $ hg debugpathcopies 1 3
43146
0171483b082f sidedatacopies: read rename information from sidedata
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 43139
diff changeset
   434
  y -> z (no-filelog !)
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   435
42486
35d674a3d5db copies: don't filter out copy targets created on other side of merge commit
Martin von Zweigbergk <martinvonz@google.com>
parents: 42427
diff changeset
   436
Create x and y, then rename x to z on one side of merge, and rename y to z and
35d674a3d5db copies: don't filter out copy targets created on other side of merge commit
Martin von Zweigbergk <martinvonz@google.com>
parents: 42427
diff changeset
   437
modify z on the other side. When storing copies in the changeset, we don't
35d674a3d5db copies: don't filter out copy targets created on other side of merge commit
Martin von Zweigbergk <martinvonz@google.com>
parents: 42427
diff changeset
   438
filter out copies whose target was created on the other side of the merge.
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   439
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   440
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   441
  $ echo y > y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   442
  $ hg ci -Aqm 'add x and y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   443
  $ hg mv x z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   444
  $ hg ci -qm 'rename x to z'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   445
  $ hg co -q 0
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   446
  $ hg mv y z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   447
  $ hg ci -qm 'rename y to z'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   448
  $ echo z >> z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   449
  $ hg ci -m 'modify z'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   450
  $ hg merge -q 1
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   451
  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
   452
  [1]
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   453
  $ echo z > z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   454
  $ hg resolve -qm z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   455
  $ hg ci -m 'merge 1 into 3'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   456
Try merging the other direction too
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   457
  $ hg co -q 1
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   458
  $ hg merge -q 3
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   459
  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
   460
  [1]
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   461
  $ echo z > z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   462
  $ hg resolve -qm z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   463
  $ hg ci -m 'merge 3 into 1'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   464
  created new head
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   465
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   466
  @    5 merge 3 into 1
42621
99ebde4fec99 commit: improve the files field of changelog for merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 42594
diff changeset
   467
  |\   z
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   468
  +---o  4 merge 1 into 3
42621
99ebde4fec99 commit: improve the files field of changelog for merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 42594
diff changeset
   469
  | |/   z
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   470
  | o  3 modify z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   471
  | |  z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   472
  | o  2 rename y to z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   473
  | |  y z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   474
  o |  1 rename x to z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   475
  |/   x z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   476
  o  0 add x and y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   477
     x y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   478
  $ hg debugpathcopies 1 4
43146
0171483b082f sidedatacopies: read rename information from sidedata
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 43139
diff changeset
   479
  y -> z (no-filelog !)
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   480
  $ hg debugpathcopies 2 4
43146
0171483b082f sidedatacopies: read rename information from sidedata
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 43139
diff changeset
   481
  x -> z (no-filelog !)
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   482
  $ hg debugpathcopies 0 4
41756
49ad315b39ee copies: do copy tracing based on ctx.p[12]copies() if configured
Martin von Zweigbergk <martinvonz@google.com>
parents: 41755
diff changeset
   483
  x -> z (filelog !)
43146
0171483b082f sidedatacopies: read rename information from sidedata
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 43139
diff changeset
   484
  y -> z (no-filelog !)
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   485
  $ hg debugpathcopies 1 5
43146
0171483b082f sidedatacopies: read rename information from sidedata
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 43139
diff changeset
   486
  y -> z (no-filelog !)
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   487
  $ hg debugpathcopies 2 5
43146
0171483b082f sidedatacopies: read rename information from sidedata
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 43139
diff changeset
   488
  x -> z (no-filelog !)
41751
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   489
  $ hg debugpathcopies 0 5
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   490
  x -> z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   491
45816
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   492
Create x and y, then remove y and rename x to y on one side of merge, and
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   493
modify x on the other side. The modification to x from the second side
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   494
should be propagated to y.
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   495
  $ newrepo
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   496
  $ echo original > x
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   497
  $ hg add x
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   498
  $ echo unrelated > y
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   499
  $ hg add y
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   500
  $ hg commit -m 'add x and y'
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   501
  $ hg remove y
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   502
  $ hg commit -m 'remove y'
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   503
  $ hg rename x y
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   504
  $ hg commit -m 'rename x to y'
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   505
  $ hg checkout -q 0
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   506
  $ echo modified > x
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   507
  $ hg commit -m 'modify x'
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   508
  created new head
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   509
  $ hg l
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   510
  @  3 modify x
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   511
  |  x
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   512
  | o  2 rename x to y
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   513
  | |  x y
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   514
  | o  1 remove y
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   515
  |/   y
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   516
  o  0 add x and y
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   517
     x y
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   518
#if filelog
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   519
  $ hg merge 2
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   520
  file 'x' was deleted in other [merge rev] but was modified in local [working copy].
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   521
  You can use (c)hanged version, (d)elete, or leave (u)nresolved.
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   522
  What do you want to do? u
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   523
  1 files updated, 0 files merged, 0 files removed, 1 files unresolved
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   524
  use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   525
  [1]
45817
58e7ee23ddbd copies: handle more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45816
diff changeset
   526
This should ideally be "modified", but we will probably not be able to fix
58e7ee23ddbd copies: handle more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45816
diff changeset
   527
that in the filelog case.
45816
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   528
  $ cat y
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   529
  original
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   530
#else
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   531
  $ hg merge 2
45817
58e7ee23ddbd copies: handle more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45816
diff changeset
   532
  merging x and y to y
58e7ee23ddbd copies: handle more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45816
diff changeset
   533
  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
45816
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   534
  (branch merge, don't forget to commit)
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   535
  $ cat y
45817
58e7ee23ddbd copies: handle more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45816
diff changeset
   536
  modified
45816
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   537
#endif
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   538
Same as above, but in the opposite direction
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   539
#if filelog
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   540
  $ hg co -qC 2
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   541
  $ hg merge 3
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   542
  file 'x' was deleted in local [working copy] but was modified in other [merge rev].
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   543
  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   544
  What do you want to do? u
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   545
  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   546
  use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   547
  [1]
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   548
BROKEN: should be "modified"
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   549
  $ cat y
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   550
  original
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   551
#else
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   552
  $ hg co -qC 2
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   553
  $ hg merge 3
45817
58e7ee23ddbd copies: handle more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45816
diff changeset
   554
  merging y and x to y
58e7ee23ddbd copies: handle more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45816
diff changeset
   555
  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
45816
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   556
  (branch merge, don't forget to commit)
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   557
  $ cat y
45817
58e7ee23ddbd copies: handle more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45816
diff changeset
   558
  modified
45816
4b79e92a5ef8 tests: test more cases where a file got replaced by a copy
Martin von Zweigbergk <martinvonz@google.com>
parents: 45798
diff changeset
   559
#endif
41930
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   560
45703
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   561
Create x and y, then rename x to z on one side of merge, and rename y to z and
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   562
then delete z on the other side.
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   563
  $ newrepo
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   564
  $ echo x > x
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   565
  $ echo y > y
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   566
  $ hg ci -Aqm 'add x and y'
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   567
  $ hg mv x z
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   568
  $ hg ci -qm 'rename x to z'
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   569
  $ hg co -q 0
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   570
  $ hg mv y z
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   571
  $ hg ci -qm 'rename y to z'
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   572
  $ hg rm z
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   573
  $ hg ci -m 'delete z'
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   574
  $ hg merge -q 1
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   575
  $ echo z > z
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   576
  $ hg ci -m 'merge 1 into 3'
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   577
Try merging the other direction too
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   578
  $ hg co -q 1
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   579
  $ hg merge -q 3
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   580
  $ echo z > z
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   581
  $ hg ci -m 'merge 3 into 1'
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   582
  created new head
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   583
  $ hg l
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   584
  @    5 merge 3 into 1
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   585
  |\   z
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   586
  +---o  4 merge 1 into 3
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   587
  | |/   z
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   588
  | o  3 delete z
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   589
  | |  z
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   590
  | o  2 rename y to z
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   591
  | |  y z
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   592
  o |  1 rename x to z
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   593
  |/   x z
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   594
  o  0 add x and y
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   595
     x y
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   596
  $ hg debugpathcopies 1 4
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   597
  $ hg debugpathcopies 2 4
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   598
  x -> z (no-filelog !)
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   599
  $ hg debugpathcopies 0 4
45798
ff7e0ca666e8 copies: make sure deleted copy info do not overwriting unrelated ones
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45771
diff changeset
   600
  x -> z (no-changeset no-compatibility !)
45703
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   601
  $ hg debugpathcopies 1 5
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   602
  $ hg debugpathcopies 2 5
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   603
  x -> z (no-filelog !)
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   604
  $ hg debugpathcopies 0 5
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   605
  x -> z
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   606
d1c44591e751 tests: add test of copies suggested by Pierre-Yves on D9159
Martin von Zweigbergk <martinvonz@google.com>
parents: 43146
diff changeset
   607
42272
cbff7f996dc4 tests: avoid the word "dirty" to mean "not a descendant of merge base"
Martin von Zweigbergk <martinvonz@google.com>
parents: 42222
diff changeset
   608
Test for a case in fullcopytracing algorithm where neither of the merging csets
cbff7f996dc4 tests: avoid the word "dirty" to mean "not a descendant of merge base"
Martin von Zweigbergk <martinvonz@google.com>
parents: 42222
diff changeset
   609
is a descendant of the merge base. This test reflects that the algorithm
cbff7f996dc4 tests: avoid the word "dirty" to mean "not a descendant of merge base"
Martin von Zweigbergk <martinvonz@google.com>
parents: 42222
diff changeset
   610
correctly finds the copies:
41930
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   611
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   612
  $ cat >> $HGRCPATH << EOF
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   613
  > [experimental]
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   614
  > evolution.createmarkers=True
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   615
  > evolution.allowunstable=True
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   616
  > EOF
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   617
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   618
  $ newrepo
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   619
  $ echo a > a
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   620
  $ hg add a
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   621
  $ hg ci -m "added a"
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   622
  $ echo b > b
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   623
  $ hg add b
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   624
  $ hg ci -m "added b"
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   625
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   626
  $ hg mv b b1
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   627
  $ hg ci -m "rename b to b1"
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   628
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   629
  $ hg up ".^"
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   630
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   631
  $ echo d > d
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   632
  $ hg add d
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   633
  $ hg ci -m "added d"
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   634
  created new head
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   635
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   636
  $ echo baba >> b
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   637
  $ hg ci --amend -m "added d, modified b"
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   638
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   639
  $ hg l --hidden
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   640
  @  4 added d, modified b
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   641
  |  b d
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   642
  | x  3 added d
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   643
  |/   d
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   644
  | o  2 rename b to b1
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   645
  |/   b b1
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   646
  o  1 added b
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   647
  |  b
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   648
  o  0 added a
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   649
     a
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   650
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   651
Grafting revision 4 on top of revision 2, showing that it respect the rename:
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   652
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   653
  $ hg up 2 -q
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   654
  $ hg graft -r 4 --base 3 --hidden
42406
f385ba70e4af changelog: optionally store added and removed files in changeset extras
Martin von Zweigbergk <martinvonz@google.com>
parents: 42272
diff changeset
   655
  grafting 4:af28412ec03c "added d, modified b" (tip) (no-changeset !)
f385ba70e4af changelog: optionally store added and removed files in changeset extras
Martin von Zweigbergk <martinvonz@google.com>
parents: 42272
diff changeset
   656
  grafting 4:6325ca0b7a1c "added d, modified b" (tip) (changeset !)
41930
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   657
  merging b1 and b to b1
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   658
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   659
  $ hg l -l1 -p
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   660
  @  5 added d, modified b
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   661
  |  b1
42222
57203e0210f8 copies: calculate mergecopies() based on pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents: 42142
diff changeset
   662
  ~  diff -r 5a4825cc2926 -r 94a2f1a0e8e2 b1 (no-changeset !)
42426
a1f87294471f copies: also encode p[12]copies destination as index into "files" list
Martin von Zweigbergk <martinvonz@google.com>
parents: 42406
diff changeset
   663
  ~  diff -r 0a0ed3b3251c -r d544fb655520 b1 (changeset !)
41930
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   664
     --- a/b1	Thu Jan 01 00:00:00 1970 +0000
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   665
     +++ b/b1	Thu Jan 01 00:00:00 1970 +0000
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   666
     @@ -1,1 +1,2 @@
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   667
      b
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   668
     +baba
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41756
diff changeset
   669
  
42272
cbff7f996dc4 tests: avoid the word "dirty" to mean "not a descendant of merge base"
Martin von Zweigbergk <martinvonz@google.com>
parents: 42222
diff changeset
   670
Test to make sure that fullcopytracing algorithm doesn't fail when neither of the
cbff7f996dc4 tests: avoid the word "dirty" to mean "not a descendant of merge base"
Martin von Zweigbergk <martinvonz@google.com>
parents: 42222
diff changeset
   671
merging csets is a descendant of the base.
41932
7694b685bb10 copies: handle a case when both merging csets are not descendant of merge base
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41931
diff changeset
   672
-------------------------------------------------------------------------------------------------
41931
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   673
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   674
  $ newrepo
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   675
  $ echo a > a
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   676
  $ hg add a
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   677
  $ hg ci -m "added a"
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   678
  $ echo b > b
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   679
  $ hg add b
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   680
  $ hg ci -m "added b"
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   681
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   682
  $ echo foobar > willconflict
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   683
  $ hg add willconflict
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   684
  $ hg ci -m "added willconflict"
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   685
  $ echo c > c
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   686
  $ hg add c
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   687
  $ hg ci -m "added c"
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   688
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   689
  $ hg l
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   690
  @  3 added c
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   691
  |  c
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   692
  o  2 added willconflict
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   693
  |  willconflict
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   694
  o  1 added b
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   695
  |  b
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   696
  o  0 added a
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   697
     a
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   698
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   699
  $ hg up ".^^"
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   700
  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   701
  $ echo d > d
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   702
  $ hg add d
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   703
  $ hg ci -m "added d"
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   704
  created new head
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   705
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   706
  $ echo barfoo > willconflict
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   707
  $ hg add willconflict
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   708
  $ hg ci --amend -m "added willconflict and d"
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   709
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   710
  $ hg l
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   711
  @  5 added willconflict and d
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   712
  |  d willconflict
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   713
  | o  3 added c
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   714
  | |  c
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   715
  | o  2 added willconflict
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   716
  |/   willconflict
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   717
  o  1 added b
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   718
  |  b
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   719
  o  0 added a
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   720
     a
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   721
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   722
  $ hg rebase -r . -d 2 -t :other
45771
f90a5c211251 rebase: change and standarize template for rebase's one-line summary
Martin von Zweigbergk <martinvonz@google.com>
parents: 45703
diff changeset
   723
  rebasing 5:5018b1509e94 tip "added willconflict and d" (no-changeset !)
f90a5c211251 rebase: change and standarize template for rebase's one-line summary
Martin von Zweigbergk <martinvonz@google.com>
parents: 45703
diff changeset
   724
  rebasing 5:af8d273bf580 tip "added willconflict and d" (changeset !)
41931
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   725
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   726
  $ hg up 3 -q
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   727
  $ hg l --hidden
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   728
  o  6 added willconflict and d
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   729
  |  d willconflict
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   730
  | x  5 added willconflict and d
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   731
  | |  d willconflict
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   732
  | | x  4 added d
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   733
  | |/   d
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   734
  +---@  3 added c
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   735
  | |    c
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   736
  o |  2 added willconflict
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   737
  |/   willconflict
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   738
  o  1 added b
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   739
  |  b
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   740
  o  0 added a
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   741
     a
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   742
42272
cbff7f996dc4 tests: avoid the word "dirty" to mean "not a descendant of merge base"
Martin von Zweigbergk <martinvonz@google.com>
parents: 42222
diff changeset
   743
Now if we trigger a merge between revision 3 and 6 using base revision 4,
cbff7f996dc4 tests: avoid the word "dirty" to mean "not a descendant of merge base"
Martin von Zweigbergk <martinvonz@google.com>
parents: 42222
diff changeset
   744
neither of the merging csets will be a descendant of the base revision:
41931
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41930
diff changeset
   745
41932
7694b685bb10 copies: handle a case when both merging csets are not descendant of merge base
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41931
diff changeset
   746
  $ hg graft -r 6 --base 4 --hidden -t :other
42406
f385ba70e4af changelog: optionally store added and removed files in changeset extras
Martin von Zweigbergk <martinvonz@google.com>
parents: 42272
diff changeset
   747
  grafting 6:99802e4f1e46 "added willconflict and d" (tip) (no-changeset !)
42427
027f1567f97f copies: separate added/removed files by newline instead of null
Martin von Zweigbergk <martinvonz@google.com>
parents: 42426
diff changeset
   748
  grafting 6:b19f0df72728 "added willconflict and d" (tip) (changeset !)