tests/test-copies.t
author Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
Tue, 02 Jul 2019 12:59:58 -0400
changeset 42621 99ebde4fec99
parent 42594 d013099c551b
child 42645 8c5a36805d5d
permissions -rw-r--r--
commit: improve the files field of changelog for merges Currently, the files list of merge commits repeats all the deletions (either actual deletions, or files that got renamed) that happened between base and p2 of the merge. If p2 is the main branch, the list can easily be much bigger than the change being merged. This results in various problems worth improving: - changelog is bigger than necessary - `hg log directory` lists many unrelated merge commits, and `hg log -v -r commit` frequently fills multiple screens worth of files - it possibly slows down adjustlinkrev, by forcing it to read more manifests, and that function can certainly be a bottleneck - the server side of pulls can waste a lot of time simply opening the filelogs for pointless files (the constant factors for opening even a tiny filelog is apparently pretty bad) So stop listing such files as described in the code. Impacted merge commits and their descendants get a different hash than they would have without this. This doesn't seem problematic, except for convert. The previous commit helped with that in the hg->hg case (but if you do svn->hg twice from scratch, hashes can still change). The rest of the description is numbers. I don't have much to report, because recreating the files list of existing repositories is not easy: - debugupgradeformat and bundle/unbundle don't recreate the list - export/import tends to choke quickly applying patches or on description that contain diffs, - merge commits from the convert extension don't have the right files list for reasons orthogonal to the current commit - replaying the merge with hg update/hg merge/hg revert --all/hg commit can end up failing in hg revert - I wasn't sure that using debugsetparents + debugrebuilddirstate would really build the right thing I measured commit time before and after this change, in a case with no files filtered out, several files filtered out (no difference) and 5k files filtered out (+1% time). Recreating the 100 more recent merges in a private repo, the concatenated uncompressed files lists goes from 1.12MB to 0.52MB. Excluding 3 merges that are not representative, then the size goes from 570k to 15k. I converted part of mozilla-central, and observed file list shrinking quite a bit too, starting at the very first merge, 733641d9feaf, going from 550 files to 10 files (although they have relatively few merges, so they probably wouldn't care). Differential Revision: https://phab.mercurial-scm.org/D6613
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
42142
5382d8f8530b changelog: parse copy metadata if available in extras
Martin von Zweigbergk <martinvonz@google.com>
parents: 41937
diff changeset
     1
#testcases filelog compatibility changeset
41760
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
41936
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
     4
  > [extensions]
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
     5
  > rebase=
41760
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
41765
49ad315b39ee copies: do copy tracing based on ctx.p[12]copies() if configured
Martin von Zweigbergk <martinvonz@google.com>
parents: 41764
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: 41764
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: 41764
diff changeset
    12
  > [experimental]
49ad315b39ee copies: do copy tracing based on ctx.p[12]copies() if configured
Martin von Zweigbergk <martinvonz@google.com>
parents: 41764
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: 41764
diff changeset
    14
  > EOF
49ad315b39ee copies: do copy tracing based on ctx.p[12]copies() if configured
Martin von Zweigbergk <martinvonz@google.com>
parents: 41764
diff changeset
    15
#endif
49ad315b39ee copies: do copy tracing based on ctx.p[12]copies() if configured
Martin von Zweigbergk <martinvonz@google.com>
parents: 41764
diff changeset
    16
42142
5382d8f8530b changelog: parse copy metadata if available in extras
Martin von Zweigbergk <martinvonz@google.com>
parents: 41937
diff changeset
    17
#if changeset
5382d8f8530b changelog: parse copy metadata if available in extras
Martin von Zweigbergk <martinvonz@google.com>
parents: 41937
diff changeset
    18
  $ cat >> $HGRCPATH << EOF
5382d8f8530b changelog: parse copy metadata if available in extras
Martin von Zweigbergk <martinvonz@google.com>
parents: 41937
diff changeset
    19
  > [experimental]
5382d8f8530b changelog: parse copy metadata if available in extras
Martin von Zweigbergk <martinvonz@google.com>
parents: 41937
diff changeset
    20
  > copies.read-from = changeset-only
5382d8f8530b changelog: parse copy metadata if available in extras
Martin von Zweigbergk <martinvonz@google.com>
parents: 41937
diff changeset
    21
  > copies.write-to = changeset-only
5382d8f8530b changelog: parse copy metadata if available in extras
Martin von Zweigbergk <martinvonz@google.com>
parents: 41937
diff changeset
    22
  > EOF
5382d8f8530b changelog: parse copy metadata if available in extras
Martin von Zweigbergk <martinvonz@google.com>
parents: 41937
diff changeset
    23
#endif
5382d8f8530b changelog: parse copy metadata if available in extras
Martin von Zweigbergk <martinvonz@google.com>
parents: 41937
diff changeset
    24
41760
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    25
  $ REPONUM=0
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    26
  $ newrepo() {
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    27
  >     cd $TESTTMP
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    28
  >     REPONUM=`expr $REPONUM + 1`
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    29
  >     hg init repo-$REPONUM
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    30
  >     cd repo-$REPONUM
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    31
  > }
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    32
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    33
Simple rename case
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    34
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    35
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    36
  $ hg ci -Aqm 'add x'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    37
  $ hg mv x y
41764
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
    38
  $ hg debugp1copies
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
    39
  x -> y
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
    40
  $ hg debugp2copies
41760
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    41
  $ hg ci -m 'rename x to y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    42
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    43
  @  1 rename x to y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    44
  |  x y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    45
  o  0 add x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    46
     x
41764
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
    47
  $ hg debugp1copies -r 1
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
    48
  x -> y
41760
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    49
  $ hg debugpathcopies 0 1
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    50
  x -> y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    51
  $ hg debugpathcopies 1 0
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    52
  y -> x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    53
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
    54
  $ hg debugpathcopies 0 1 x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    55
  $ hg debugpathcopies 1 0 x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    56
  y -> x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    57
  $ hg debugpathcopies 0 1 y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    58
  x -> y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    59
  $ hg debugpathcopies 1 0 y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    60
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    61
Copy a file onto another file
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    62
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    63
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    64
  $ echo y > y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    65
  $ hg ci -Aqm 'add x and y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    66
  $ hg cp -f x y
41764
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
    67
  $ hg debugp1copies
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
    68
  x -> y
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
    69
  $ hg debugp2copies
41760
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    70
  $ hg ci -m 'copy x onto y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    71
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    72
  @  1 copy x onto y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    73
  |  y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    74
  o  0 add x and y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    75
     x y
41764
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
    76
  $ hg debugp1copies -r 1
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
    77
  x -> y
41760
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    78
Incorrectly doesn't show the rename
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    79
  $ hg debugpathcopies 0 1
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    80
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    81
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
    82
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
    83
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    84
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    85
  $ echo x > x2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    86
  $ 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
    87
  $ hg cp -f x x2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    88
  $ hg ci -m 'copy x onto x2'
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 x2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    91
  |  x2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    92
  o  0 add x and x2 with same content
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    93
     x x2
41764
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
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: 41763
diff changeset
    95
  x -> x2
41760
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    96
Incorrectly doesn't show the rename
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    97
  $ hg debugpathcopies 0 1
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    98
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    99
Rename file in a loop: x->y->z->x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   100
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   101
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   102
  $ hg ci -Aqm 'add x'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   103
  $ hg mv x y
41764
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
   104
  $ hg debugp1copies
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
   105
  x -> y
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
   106
  $ hg debugp2copies
41760
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   107
  $ hg ci -m 'rename x to y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   108
  $ hg mv y z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   109
  $ hg ci -m 'rename y to z'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   110
  $ hg mv z x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   111
  $ hg ci -m 'rename z to x'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   112
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   113
  @  3 rename z to x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   114
  |  x z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   115
  o  2 rename y to z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   116
  |  y z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   117
  o  1 rename x to y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   118
  |  x y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   119
  o  0 add x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   120
     x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   121
  $ hg debugpathcopies 0 3
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   122
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   123
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
   124
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
   125
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
   126
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   127
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   128
  $ echo x > x2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   129
  $ 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
   130
  $ hg cp x z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   131
  $ hg ci -qm 'copy x to z'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   132
  $ hg rm z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   133
  $ hg ci -m 'remove z'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   134
  $ hg cp x2 z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   135
  $ hg ci -m 'copy x2 to z'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   136
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   137
  @  3 copy x2 to z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   138
  |  z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   139
  o  2 remove z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   140
  |  z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   141
  o  1 copy x to z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   142
  |  z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   143
  o  0 add x and x2 with same content
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   144
     x x2
41764
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
   145
  $ hg debugp1copies -r 3
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
   146
  x2 -> z
41760
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   147
  $ hg debugpathcopies 0 3
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   148
  x2 -> z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   149
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   150
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
   151
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   152
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   153
  $ echo y > y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   154
  $ hg ci -Aqm 'add x and y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   155
  $ hg mv x z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   156
  $ hg ci -qm 'rename x to z'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   157
  $ hg co -q 0
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   158
  $ hg mv y z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   159
  $ hg ci -qm 'rename y to z'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   160
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   161
  @  2 rename y to z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   162
  |  y z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   163
  | o  1 rename x to z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   164
  |/   x z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   165
  o  0 add x and y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   166
     x y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   167
  $ hg debugpathcopies 1 2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   168
  z -> x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   169
  y -> z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   170
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   171
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
   172
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   173
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   174
  $ hg ci -Aqm 'add x'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   175
  $ hg mv x y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   176
  $ hg ci -m 'rename x to y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   177
  $ hg co -q 0
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   178
  $ hg rm x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   179
  $ hg ci -m 'remove x'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   180
  created new head
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   181
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   182
  @  2 remove x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   183
  |  x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   184
  | o  1 rename x to y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   185
  |/   x y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   186
  o  0 add x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   187
     x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   188
  $ hg debugpathcopies 1 2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   189
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   190
Merge rename from other branch
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   191
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   192
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   193
  $ hg ci -Aqm 'add x'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   194
  $ hg mv x y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   195
  $ hg ci -m 'rename x to y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   196
  $ hg co -q 0
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   197
  $ echo z > z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   198
  $ hg ci -Aqm 'add z'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   199
  $ hg merge -q 1
41764
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
   200
  $ hg debugp1copies
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
   201
  $ hg debugp2copies
41760
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   202
  $ hg ci -m 'merge rename from p2'
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
  @    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
   205
  |\
41760
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   206
  | o  2 add z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   207
  | |  z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   208
  o |  1 rename x to y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   209
  |/   x y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   210
  o  0 add x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   211
     x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   212
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
   213
merges, so...
41764
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
   214
  $ hg debugp1copies -r 3
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
   215
  $ hg debugp2copies -r 3
41760
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   216
  $ hg debugpathcopies 0 3
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   217
  x -> y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   218
  $ hg debugpathcopies 1 2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   219
  y -> x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   220
  $ hg debugpathcopies 1 3
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   221
  $ hg debugpathcopies 2 3
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   222
  x -> y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   223
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   224
Copy file from either side in a merge
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   225
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   226
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   227
  $ hg ci -Aqm 'add x'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   228
  $ hg co -q null
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   229
  $ echo y > y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   230
  $ hg ci -Aqm 'add y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   231
  $ hg merge -q 0
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   232
  $ hg cp y z
41764
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
   233
  $ hg debugp1copies
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
   234
  y -> z
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
   235
  $ hg debugp2copies
41760
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   236
  $ hg ci -m 'copy file from p1 in merge'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   237
  $ hg co -q 1
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   238
  $ hg merge -q 0
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   239
  $ hg cp x z
41764
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
   240
  $ hg debugp1copies
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
   241
  $ hg debugp2copies
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
   242
  x -> z
41760
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   243
  $ hg ci -qm 'copy file from p2 in merge'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   244
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   245
  @    3 copy file from p2 in merge
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   246
  |\   z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   247
  +---o  2 copy file from p1 in merge
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   248
  | |/   z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   249
  | o  1 add y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   250
  |    y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   251
  o  0 add x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   252
     x
41764
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
   253
  $ hg debugp1copies -r 2
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
   254
  y -> z
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
   255
  $ hg debugp2copies -r 2
41760
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   256
  $ hg debugpathcopies 1 2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   257
  y -> z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   258
  $ hg debugpathcopies 0 2
41764
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
   259
  $ hg debugp1copies -r 3
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
   260
  $ hg debugp2copies -r 3
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
   261
  x -> z
41760
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   262
  $ hg debugpathcopies 1 3
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   263
  $ hg debugpathcopies 0 3
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   264
  x -> z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   265
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   266
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
   267
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   268
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   269
  $ hg ci -Aqm 'add x on branch 1'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   270
  $ hg co -q null
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   271
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   272
  $ hg ci -Aqm 'add x on branch 2'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   273
  $ hg merge -q 0
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   274
  $ hg cp x z
41764
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
   275
  $ hg debugp1copies
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
   276
  x -> z
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
   277
  $ hg debugp2copies
41760
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   278
  $ hg ci -qm 'merge'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   279
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   280
  @    2 merge
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   281
  |\   z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   282
  | o  1 add x on branch 2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   283
  |    x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   284
  o  0 add x on branch 1
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   285
     x
41764
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
   286
  $ hg debugp1copies -r 2
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
   287
  x -> z
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
   288
  $ hg debugp2copies -r 2
41760
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   289
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
   290
  $ hg debugpathcopies 1 2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   291
  x -> z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   292
  $ hg debugpathcopies 0 2
41765
49ad315b39ee copies: do copy tracing based on ctx.p[12]copies() if configured
Martin von Zweigbergk <martinvonz@google.com>
parents: 41764
diff changeset
   293
  x -> z (filelog !)
41760
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   294
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   295
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
   296
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   297
  $ echo branch1 > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   298
  $ hg ci -Aqm 'add x on branch 1'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   299
  $ hg co -q null
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   300
  $ echo branch2 > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   301
  $ hg ci -Aqm 'add x on branch 2'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   302
  $ hg merge -q 0
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   303
  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
   304
  [1]
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   305
  $ echo resolved > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   306
  $ hg resolve -m x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   307
  (no more unresolved files)
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   308
  $ hg cp x z
41764
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
   309
  $ hg debugp1copies
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
   310
  x -> z
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
   311
  $ hg debugp2copies
41760
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   312
  $ hg ci -qm 'merge'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   313
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   314
  @    2 merge
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   315
  |\   x z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   316
  | o  1 add x on branch 2
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   317
  |    x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   318
  o  0 add x on branch 1
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   319
     x
41764
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
   320
  $ hg debugp1copies -r 2
42142
5382d8f8530b changelog: parse copy metadata if available in extras
Martin von Zweigbergk <martinvonz@google.com>
parents: 41937
diff changeset
   321
  x -> z (changeset !)
41764
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
   322
  $ hg debugp2copies -r 2
42142
5382d8f8530b changelog: parse copy metadata if available in extras
Martin von Zweigbergk <martinvonz@google.com>
parents: 41937
diff changeset
   323
  x -> z (no-changeset !)
41760
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   324
  $ hg debugpathcopies 1 2
42142
5382d8f8530b changelog: parse copy metadata if available in extras
Martin von Zweigbergk <martinvonz@google.com>
parents: 41937
diff changeset
   325
  x -> z (changeset !)
41760
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   326
  $ hg debugpathcopies 0 2
42142
5382d8f8530b changelog: parse copy metadata if available in extras
Martin von Zweigbergk <martinvonz@google.com>
parents: 41937
diff changeset
   327
  x -> z (no-changeset !)
41760
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   328
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   329
Copy x->y on one side of merge and copy x->z on the other side. Pathcopies from one parent
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   330
of the merge to the merge should include the copy from the other side.
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   331
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   332
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   333
  $ hg ci -Aqm 'add x'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   334
  $ hg cp x y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   335
  $ hg ci -qm 'copy x to y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   336
  $ hg co -q 0
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   337
  $ hg cp x z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   338
  $ hg ci -qm 'copy x to z'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   339
  $ hg merge -q 1
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   340
  $ hg ci -m 'merge copy x->y and copy x->z'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   341
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   342
  @    3 merge copy x->y and copy x->z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   343
  |\
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   344
  | o  2 copy x to z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   345
  | |  z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   346
  o |  1 copy x to y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   347
  |/   y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   348
  o  0 add x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   349
     x
41764
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
   350
  $ hg debugp1copies -r 3
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
   351
  $ hg debugp2copies -r 3
41760
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   352
  $ hg debugpathcopies 2 3
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   353
  x -> y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   354
  $ hg debugpathcopies 1 3
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   355
  x -> z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   356
42594
d013099c551b copies: filter invalid copies only at end of pathcopies() (issue6163)
Martin von Zweigbergk <martinvonz@google.com>
parents: 42589
diff changeset
   357
Copy x to y on one side of merge, create y and rename to z on the other side.
41760
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   358
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   359
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   360
  $ hg ci -Aqm 'add x'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   361
  $ hg cp x y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   362
  $ hg ci -qm 'copy x to y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   363
  $ hg co -q 0
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   364
  $ echo y > y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   365
  $ hg ci -Aqm 'add y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   366
  $ hg mv y z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   367
  $ hg ci -m 'rename y to z'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   368
  $ hg merge -q 1
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   369
  $ hg ci -m 'merge'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   370
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   371
  @    4 merge
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   372
  |\
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   373
  | o  3 rename y to z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   374
  | |  y z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   375
  | o  2 add y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   376
  | |  y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   377
  o |  1 copy x to y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   378
  |/   y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   379
  o  0 add x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   380
     x
41764
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
   381
  $ hg debugp1copies -r 3
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
   382
  y -> z
a4358f7345b4 context: introduce p[12]copies() methods and debugp[12]copies commands
Martin von Zweigbergk <martinvonz@google.com>
parents: 41763
diff changeset
   383
  $ hg debugp2copies -r 3
41760
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   384
  $ hg debugpathcopies 2 3
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   385
  y -> z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   386
  $ hg debugpathcopies 1 3
42594
d013099c551b copies: filter invalid copies only at end of pathcopies() (issue6163)
Martin von Zweigbergk <martinvonz@google.com>
parents: 42589
diff changeset
   387
  y -> z (no-filelog !)
41760
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   388
42501
35d674a3d5db copies: don't filter out copy targets created on other side of merge commit
Martin von Zweigbergk <martinvonz@google.com>
parents: 42443
diff changeset
   389
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: 42443
diff changeset
   390
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: 42443
diff changeset
   391
filter out copies whose target was created on the other side of the merge.
41760
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   392
  $ newrepo
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   393
  $ echo x > x
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   394
  $ echo y > y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   395
  $ hg ci -Aqm 'add x and y'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   396
  $ hg mv x z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   397
  $ hg ci -qm 'rename x to z'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   398
  $ hg co -q 0
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   399
  $ hg mv y z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   400
  $ hg ci -qm 'rename y to z'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   401
  $ echo z >> z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   402
  $ hg ci -m 'modify z'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   403
  $ hg merge -q 1
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   404
  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
   405
  [1]
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   406
  $ echo z > z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   407
  $ hg resolve -qm z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   408
  $ hg ci -m 'merge 1 into 3'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   409
Try merging the other direction too
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   410
  $ hg co -q 1
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   411
  $ hg merge -q 3
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   412
  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
   413
  [1]
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   414
  $ echo z > z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   415
  $ hg resolve -qm z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   416
  $ hg ci -m 'merge 3 into 1'
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   417
  created new head
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   418
  $ hg l
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   419
  @    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
   420
  |\   z
41760
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   421
  +---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
   422
  | |/   z
41760
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   423
  | o  3 modify z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   424
  | |  z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   425
  | o  2 rename y to z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   426
  | |  y z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   427
  o |  1 rename x to z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   428
  |/   x z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   429
  o  0 add x and y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   430
     x y
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   431
  $ hg debugpathcopies 1 4
42501
35d674a3d5db copies: don't filter out copy targets created on other side of merge commit
Martin von Zweigbergk <martinvonz@google.com>
parents: 42443
diff changeset
   432
  y -> z (no-filelog !)
41760
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   433
  $ hg debugpathcopies 2 4
42501
35d674a3d5db copies: don't filter out copy targets created on other side of merge commit
Martin von Zweigbergk <martinvonz@google.com>
parents: 42443
diff changeset
   434
  x -> z (no-filelog !)
41760
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   435
  $ hg debugpathcopies 0 4
41765
49ad315b39ee copies: do copy tracing based on ctx.p[12]copies() if configured
Martin von Zweigbergk <martinvonz@google.com>
parents: 41764
diff changeset
   436
  x -> z (filelog !)
49ad315b39ee copies: do copy tracing based on ctx.p[12]copies() if configured
Martin von Zweigbergk <martinvonz@google.com>
parents: 41764
diff changeset
   437
  y -> z (compatibility !)
42177
c1850798f995 run-tests: stop matching line for missing feature
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42142
diff changeset
   438
  y -> z (changeset !)
41760
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   439
  $ hg debugpathcopies 1 5
42501
35d674a3d5db copies: don't filter out copy targets created on other side of merge commit
Martin von Zweigbergk <martinvonz@google.com>
parents: 42443
diff changeset
   440
  y -> z (no-filelog !)
41760
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   441
  $ hg debugpathcopies 2 5
42501
35d674a3d5db copies: don't filter out copy targets created on other side of merge commit
Martin von Zweigbergk <martinvonz@google.com>
parents: 42443
diff changeset
   442
  x -> z (no-filelog !)
41760
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   443
  $ hg debugpathcopies 0 5
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   444
  x -> z
4ec0ce0fb929 tests: add tests of pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   445
41935
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41765
diff changeset
   446
42299
cbff7f996dc4 tests: avoid the word "dirty" to mean "not a descendant of merge base"
Martin von Zweigbergk <martinvonz@google.com>
parents: 42252
diff changeset
   447
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: 42252
diff changeset
   448
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: 42252
diff changeset
   449
correctly finds the copies:
41935
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41765
diff changeset
   450
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41765
diff changeset
   451
  $ 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: 41765
diff changeset
   452
  > [experimental]
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41765
diff changeset
   453
  > 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: 41765
diff changeset
   454
  > 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: 41765
diff changeset
   455
  > EOF
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41765
diff changeset
   456
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41765
diff changeset
   457
  $ newrepo
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41765
diff changeset
   458
  $ 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: 41765
diff changeset
   459
  $ 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: 41765
diff changeset
   460
  $ 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: 41765
diff changeset
   461
  $ 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: 41765
diff changeset
   462
  $ 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: 41765
diff changeset
   463
  $ 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: 41765
diff changeset
   464
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41765
diff changeset
   465
  $ 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: 41765
diff changeset
   466
  $ 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: 41765
diff changeset
   467
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41765
diff changeset
   468
  $ hg up ".^"
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41765
diff changeset
   469
  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: 41765
diff changeset
   470
  $ 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: 41765
diff changeset
   471
  $ 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: 41765
diff changeset
   472
  $ 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: 41765
diff changeset
   473
  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: 41765
diff changeset
   474
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41765
diff changeset
   475
  $ 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: 41765
diff changeset
   476
  $ 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: 41765
diff changeset
   477
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41765
diff changeset
   478
  $ 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: 41765
diff changeset
   479
  @  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: 41765
diff changeset
   480
  |  b d
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41765
diff changeset
   481
  | 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: 41765
diff changeset
   482
  |/   d
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41765
diff changeset
   483
  | 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: 41765
diff changeset
   484
  |/   b b1
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41765
diff changeset
   485
  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: 41765
diff changeset
   486
  |  b
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41765
diff changeset
   487
  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: 41765
diff changeset
   488
     a
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41765
diff changeset
   489
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41765
diff changeset
   490
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: 41765
diff changeset
   491
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41765
diff changeset
   492
  $ 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: 41765
diff changeset
   493
  $ hg graft -r 4 --base 3 --hidden
42425
f385ba70e4af changelog: optionally store added and removed files in changeset extras
Martin von Zweigbergk <martinvonz@google.com>
parents: 42299
diff changeset
   494
  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: 42299
diff changeset
   495
  grafting 4:6325ca0b7a1c "added d, modified b" (tip) (changeset !)
41935
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41765
diff changeset
   496
  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: 41765
diff changeset
   497
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41765
diff changeset
   498
  $ 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: 41765
diff changeset
   499
  @  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: 41765
diff changeset
   500
  |  b1
42252
57203e0210f8 copies: calculate mergecopies() based on pathcopies()
Martin von Zweigbergk <martinvonz@google.com>
parents: 42142
diff changeset
   501
  ~  diff -r 5a4825cc2926 -r 94a2f1a0e8e2 b1 (no-changeset !)
42442
a1f87294471f copies: also encode p[12]copies destination as index into "files" list
Martin von Zweigbergk <martinvonz@google.com>
parents: 42425
diff changeset
   502
  ~  diff -r 0a0ed3b3251c -r d544fb655520 b1 (changeset !)
41935
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41765
diff changeset
   503
     --- 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: 41765
diff changeset
   504
     +++ 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: 41765
diff changeset
   505
     @@ -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: 41765
diff changeset
   506
      b
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41765
diff changeset
   507
     +baba
cbdd2b56d4c3 copies: add test that makes both the merging csets dirty and run w/o error
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41765
diff changeset
   508
  
42299
cbff7f996dc4 tests: avoid the word "dirty" to mean "not a descendant of merge base"
Martin von Zweigbergk <martinvonz@google.com>
parents: 42252
diff changeset
   509
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: 42252
diff changeset
   510
merging csets is a descendant of the base.
41937
7694b685bb10 copies: handle a case when both merging csets are not descendant of merge base
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41936
diff changeset
   511
-------------------------------------------------------------------------------------------------
41936
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   512
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   513
  $ newrepo
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   514
  $ echo a > a
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   515
  $ hg add a
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   516
  $ hg ci -m "added a"
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   517
  $ echo b > b
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   518
  $ hg add b
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   519
  $ hg ci -m "added b"
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   520
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   521
  $ echo foobar > willconflict
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   522
  $ hg add willconflict
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   523
  $ hg ci -m "added willconflict"
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   524
  $ echo c > c
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   525
  $ hg add c
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   526
  $ hg ci -m "added c"
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   527
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   528
  $ hg l
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   529
  @  3 added c
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   530
  |  c
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   531
  o  2 added willconflict
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   532
  |  willconflict
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   533
  o  1 added b
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   534
  |  b
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   535
  o  0 added a
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   536
     a
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   537
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   538
  $ hg up ".^^"
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   539
  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: 41935
diff changeset
   540
  $ echo d > d
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   541
  $ hg add d
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   542
  $ hg ci -m "added d"
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   543
  created new head
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   544
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   545
  $ echo barfoo > willconflict
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   546
  $ hg add willconflict
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   547
  $ 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: 41935
diff changeset
   548
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   549
  $ hg l
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   550
  @  5 added willconflict and d
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   551
  |  d willconflict
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   552
  | o  3 added c
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   553
  | |  c
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   554
  | o  2 added willconflict
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   555
  |/   willconflict
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   556
  o  1 added b
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   557
  |  b
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   558
  o  0 added a
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   559
     a
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   560
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   561
  $ hg rebase -r . -d 2 -t :other
42425
f385ba70e4af changelog: optionally store added and removed files in changeset extras
Martin von Zweigbergk <martinvonz@google.com>
parents: 42299
diff changeset
   562
  rebasing 5:5018b1509e94 "added willconflict and d" (tip) (no-changeset !)
42443
027f1567f97f copies: separate added/removed files by newline instead of null
Martin von Zweigbergk <martinvonz@google.com>
parents: 42442
diff changeset
   563
  rebasing 5:af8d273bf580 "added willconflict and d" (tip) (changeset !)
41936
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   564
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   565
  $ hg up 3 -q
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   566
  $ hg l --hidden
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   567
  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: 41935
diff changeset
   568
  |  d willconflict
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   569
  | 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: 41935
diff changeset
   570
  | |  d willconflict
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   571
  | | x  4 added d
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   572
  | |/   d
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   573
  +---@  3 added c
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   574
  | |    c
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   575
  o |  2 added willconflict
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   576
  |/   willconflict
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   577
  o  1 added b
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   578
  |  b
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   579
  o  0 added a
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   580
     a
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   581
42299
cbff7f996dc4 tests: avoid the word "dirty" to mean "not a descendant of merge base"
Martin von Zweigbergk <martinvonz@google.com>
parents: 42252
diff changeset
   582
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: 42252
diff changeset
   583
neither of the merging csets will be a descendant of the base revision:
41936
fc4b7a46fda1 copies: add test that makes both the merging csets dirty and fails
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41935
diff changeset
   584
41937
7694b685bb10 copies: handle a case when both merging csets are not descendant of merge base
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 41936
diff changeset
   585
  $ hg graft -r 6 --base 4 --hidden -t :other
42425
f385ba70e4af changelog: optionally store added and removed files in changeset extras
Martin von Zweigbergk <martinvonz@google.com>
parents: 42299
diff changeset
   586
  grafting 6:99802e4f1e46 "added willconflict and d" (tip) (no-changeset !)
42443
027f1567f97f copies: separate added/removed files by newline instead of null
Martin von Zweigbergk <martinvonz@google.com>
parents: 42442
diff changeset
   587
  grafting 6:b19f0df72728 "added willconflict and d" (tip) (changeset !)