tests/test-conflict.t
author Pierre-Yves David <pierre-yves.david@fb.com>
Tue, 23 Dec 2014 15:30:38 -0800
changeset 23702 c48924787eaa
parent 22028 3d0572ab3b4a
child 26224 a4da463df6cf
permissions -rw-r--r--
filectx.parents: enforce changeid of parent to be in own changectx ancestors Because of the way filenodes are computed, you can have multiple changesets "introducing" the same file revision. For example, in the changeset graph below, changeset 2 and 3 both change a file -to- and -from- the same content. o 3: content = new | | o 2: content = new |/ o 1: content = old In such cases, the file revision is create once, when 2 is added, and just reused for 3. So the file change in '3' (from "old" to "new)" has no linkrev pointing to it). We'll call this situation "linkrev-shadowing". As the linkrev is used for optimization purposes when walking a file history, the linkrev-shadowing results in an unexpected jump to another branch during such a walk.. This leads to multiple bugs with log, annotate and rename detection. One element to fix such bugs is to ensure that walking the file history sticks on the same topology as the changeset's history. For this purpose, we extend the logic in 'basefilectx.parents' so that it always defines the proper changeset to associate the parent file revision with. This "proper" changeset has to be an ancestor of the changeset associated with the child file revision. This logic is performed in the '_adjustlinkrev' function. This function is given the starting changeset and all the information regarding the parent file revision. If the linkrev for the file revision is an ancestor of the starting changeset, the linkrev is valid and will be used. If it is not, we detected a topological jump caused by linkrev shadowing, we are going to walk the ancestors of the starting changeset until we find one setting the file to the revision we are trying to create. The performance impact appears acceptable: - We are walking the changelog once for each filelog traversal (as there should be no overlap between searches), - changelog traversal itself is fairly cheap, compared to what is likely going to be perform on the result on the filelog traversal, - We only touch the manifest for ancestors touching the file, And such changesets are likely to be the one introducing the file. (except in pathological cases involving merge), - We use manifest diff instead of full manifest unpacking to check manifest content, so it does not involve applying multiple diffs in most case. - linkrev shadowing is not the common case. Tests for fixed issues in log, annotate and rename detection have been added. But this changeset does not solve all problems. It fixes -ancestry- computation, but if the linkrev-shadowed changesets is the starting one, we'll still get things wrong. We'll have to fix the bootstrapping of such operations in a later changeset. Also, the usage of `hg log FILE` without --follow still has issues with linkrev pointing to hidden changesets, because it relies on the `filelog` revset which implement its own traversal logic that is still to be fixed. Thanks goes to: - Matt Mackall: for nudging me in the right direction - Julien Cristau and RĂ©mi Cardona: for keep telling me linkrev bug were an evolution show stopper for 3 years. - Durham Goode: for finding a new linkrev issue every few weeks - Mads Kiilerich: for that last rename bug who raise this topic over my anoyance limit.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11797
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
     1
  $ hg init
21920
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
     2
  $ cat << EOF > a
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
     3
  > Small Mathematical Series.
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
     4
  > One
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
     5
  > Two
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
     6
  > Three
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
     7
  > Four
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
     8
  > Five
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
     9
  > Hop we are done.
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    10
  > EOF
11797
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
    11
  $ hg add a
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11797
diff changeset
    12
  $ hg commit -m ancestor
21920
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    13
  $ cat << EOF > a
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    14
  > Small Mathematical Series.
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    15
  > 1
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    16
  > 2
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    17
  > 3
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    18
  > 4
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    19
  > 5
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    20
  > Hop we are done.
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    21
  > EOF
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11797
diff changeset
    22
  $ hg commit -m branch1
11797
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
    23
  $ hg co 0
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
    24
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
21920
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    25
  $ cat << EOF > a
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    26
  > Small Mathematical Series.
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    27
  > 1
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    28
  > 2
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    29
  > 3
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    30
  > 6
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    31
  > 8
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    32
  > Hop we are done.
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    33
  > EOF
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11797
diff changeset
    34
  $ hg commit -m branch2
11797
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
    35
  created new head
346
f69a5d2d4fe1 merge3: fix argument order
mpm@selenic.com
parents:
diff changeset
    36
11797
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
    37
  $ hg merge 1
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
    38
  merging a
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
    39
  warning: conflicts during merge.
15501
2371f4aea665 merge: give a special message for internal:merge failure (issue3105)
Matt Mackall <mpm@selenic.com>
parents: 12316
diff changeset
    40
  merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
11797
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
    41
  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
12314
f2daa6ab514a merge: suggest 'hg up -C .' for discarding changes, not 'hg up -C'
Brodie Rao <brodie@bitheap.org>
parents: 12156
diff changeset
    42
  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12314
diff changeset
    43
  [1]
11797
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
    44
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
    45
  $ hg id
21920
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    46
  618808747361+c0c68e4fe667+ tip
11797
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
    47
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
    48
  $ cat a
21920
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    49
  Small Mathematical Series.
21921
ecc1387138ba filemerge: use non-minimal conflict marker regions (BC)
Matt Mackall <mpm@selenic.com>
parents: 21920
diff changeset
    50
  <<<<<<< local: 618808747361 - test: branch2
21920
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    51
  1
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    52
  2
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    53
  3
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    54
  6
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    55
  8
21519
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
    56
  =======
21921
ecc1387138ba filemerge: use non-minimal conflict marker regions (BC)
Matt Mackall <mpm@selenic.com>
parents: 21920
diff changeset
    57
  1
ecc1387138ba filemerge: use non-minimal conflict marker regions (BC)
Matt Mackall <mpm@selenic.com>
parents: 21920
diff changeset
    58
  2
ecc1387138ba filemerge: use non-minimal conflict marker regions (BC)
Matt Mackall <mpm@selenic.com>
parents: 21920
diff changeset
    59
  3
21920
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    60
  4
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    61
  5
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    62
  >>>>>>> other: c0c68e4fe667  - test: branch1
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    63
  Hop we are done.
21519
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
    64
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
    65
  $ hg status
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
    66
  M a
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
    67
  ? a.orig
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
    68
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
    69
Verify custom conflict markers
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
    70
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
    71
  $ hg up -q --clean .
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
    72
  $ printf "\n[ui]\nmergemarkertemplate={author} {rev}\n" >> .hg/hgrc
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
    73
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
    74
  $ hg merge 1
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
    75
  merging a
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
    76
  warning: conflicts during merge.
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
    77
  merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
    78
  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
    79
  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
    80
  [1]
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
    81
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
    82
  $ cat a
21920
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    83
  Small Mathematical Series.
21921
ecc1387138ba filemerge: use non-minimal conflict marker regions (BC)
Matt Mackall <mpm@selenic.com>
parents: 21920
diff changeset
    84
  <<<<<<< local: test 2
21920
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    85
  1
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    86
  2
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    87
  3
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    88
  6
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    89
  8
21519
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
    90
  =======
21921
ecc1387138ba filemerge: use non-minimal conflict marker regions (BC)
Matt Mackall <mpm@selenic.com>
parents: 21920
diff changeset
    91
  1
ecc1387138ba filemerge: use non-minimal conflict marker regions (BC)
Matt Mackall <mpm@selenic.com>
parents: 21920
diff changeset
    92
  2
ecc1387138ba filemerge: use non-minimal conflict marker regions (BC)
Matt Mackall <mpm@selenic.com>
parents: 21920
diff changeset
    93
  3
21920
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    94
  4
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    95
  5
21519
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
    96
  >>>>>>> other: test 1
21920
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    97
  Hop we are done.
21519
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
    98
21864
755bf1bbe0a9 filemerge: use only the first line of the generated conflict marker for safety
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21693
diff changeset
    99
Verify line splitting of custom conflict marker which causes multiple lines
755bf1bbe0a9 filemerge: use only the first line of the generated conflict marker for safety
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21693
diff changeset
   100
755bf1bbe0a9 filemerge: use only the first line of the generated conflict marker for safety
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21693
diff changeset
   101
  $ hg up -q --clean .
755bf1bbe0a9 filemerge: use only the first line of the generated conflict marker for safety
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21693
diff changeset
   102
  $ cat >> .hg/hgrc <<EOF
755bf1bbe0a9 filemerge: use only the first line of the generated conflict marker for safety
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21693
diff changeset
   103
  > [ui]
755bf1bbe0a9 filemerge: use only the first line of the generated conflict marker for safety
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21693
diff changeset
   104
  > mergemarkertemplate={author} {rev}\nfoo\nbar\nbaz
755bf1bbe0a9 filemerge: use only the first line of the generated conflict marker for safety
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21693
diff changeset
   105
  > EOF
755bf1bbe0a9 filemerge: use only the first line of the generated conflict marker for safety
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21693
diff changeset
   106
755bf1bbe0a9 filemerge: use only the first line of the generated conflict marker for safety
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21693
diff changeset
   107
  $ hg -q merge 1
755bf1bbe0a9 filemerge: use only the first line of the generated conflict marker for safety
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21693
diff changeset
   108
  warning: conflicts during merge.
755bf1bbe0a9 filemerge: use only the first line of the generated conflict marker for safety
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21693
diff changeset
   109
  merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
755bf1bbe0a9 filemerge: use only the first line of the generated conflict marker for safety
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21693
diff changeset
   110
  [1]
755bf1bbe0a9 filemerge: use only the first line of the generated conflict marker for safety
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21693
diff changeset
   111
755bf1bbe0a9 filemerge: use only the first line of the generated conflict marker for safety
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21693
diff changeset
   112
  $ cat a
21920
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   113
  Small Mathematical Series.
21921
ecc1387138ba filemerge: use non-minimal conflict marker regions (BC)
Matt Mackall <mpm@selenic.com>
parents: 21920
diff changeset
   114
  <<<<<<< local: test 2
21920
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   115
  1
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   116
  2
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   117
  3
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   118
  6
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   119
  8
21864
755bf1bbe0a9 filemerge: use only the first line of the generated conflict marker for safety
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21693
diff changeset
   120
  =======
21921
ecc1387138ba filemerge: use non-minimal conflict marker regions (BC)
Matt Mackall <mpm@selenic.com>
parents: 21920
diff changeset
   121
  1
ecc1387138ba filemerge: use non-minimal conflict marker regions (BC)
Matt Mackall <mpm@selenic.com>
parents: 21920
diff changeset
   122
  2
ecc1387138ba filemerge: use non-minimal conflict marker regions (BC)
Matt Mackall <mpm@selenic.com>
parents: 21920
diff changeset
   123
  3
21920
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   124
  4
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   125
  5
21864
755bf1bbe0a9 filemerge: use only the first line of the generated conflict marker for safety
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21693
diff changeset
   126
  >>>>>>> other: test 1
21920
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   127
  Hop we are done.
21864
755bf1bbe0a9 filemerge: use only the first line of the generated conflict marker for safety
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21693
diff changeset
   128
21865
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   129
Verify line trimming of custom conflict marker using multi-byte characters
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   130
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   131
  $ hg up -q --clean .
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   132
  $ python <<EOF
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   133
  > fp = open('logfile', 'w')
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   134
  > fp.write('12345678901234567890123456789012345678901234567890' +
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   135
  >          '1234567890') # there are 5 more columns for 80 columns
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   136
  > 
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   137
  > # 2 x 4 = 8 columns, but 3 x 4 = 12 bytes
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   138
  > fp.write(u'\u3042\u3044\u3046\u3048'.encode('utf-8'))
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   139
  > 
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   140
  > fp.close()
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   141
  > EOF
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   142
  $ hg add logfile
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   143
  $ hg --encoding utf-8 commit --logfile logfile
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   144
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   145
  $ cat >> .hg/hgrc <<EOF
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   146
  > [ui]
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   147
  > mergemarkertemplate={desc|firstline}
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   148
  > EOF
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   149
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   150
  $ hg -q --encoding utf-8 merge 1
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   151
  warning: conflicts during merge.
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   152
  merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   153
  [1]
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   154
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   155
  $ cat a
21920
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   156
  Small Mathematical Series.
21921
ecc1387138ba filemerge: use non-minimal conflict marker regions (BC)
Matt Mackall <mpm@selenic.com>
parents: 21920
diff changeset
   157
  <<<<<<< local: 123456789012345678901234567890123456789012345678901234567890\xe3\x81\x82... (esc)
21920
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   158
  1
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   159
  2
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   160
  3
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   161
  6
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   162
  8
21865
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   163
  =======
21921
ecc1387138ba filemerge: use non-minimal conflict marker regions (BC)
Matt Mackall <mpm@selenic.com>
parents: 21920
diff changeset
   164
  1
ecc1387138ba filemerge: use non-minimal conflict marker regions (BC)
Matt Mackall <mpm@selenic.com>
parents: 21920
diff changeset
   165
  2
ecc1387138ba filemerge: use non-minimal conflict marker regions (BC)
Matt Mackall <mpm@selenic.com>
parents: 21920
diff changeset
   166
  3
21920
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   167
  4
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   168
  5
21865
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   169
  >>>>>>> other: branch1
21920
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   170
  Hop we are done.
21865
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   171
21519
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
   172
Verify basic conflict markers
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
   173
21865
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   174
  $ hg up -q --clean 2
21519
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
   175
  $ printf "\n[ui]\nmergemarkers=basic\n" >> .hg/hgrc
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
   176
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
   177
  $ hg merge 1
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
   178
  merging a
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
   179
  warning: conflicts during merge.
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
   180
  merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
   181
  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
   182
  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
   183
  [1]
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
   184
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
   185
  $ cat a
21920
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   186
  Small Mathematical Series.
21921
ecc1387138ba filemerge: use non-minimal conflict marker regions (BC)
Matt Mackall <mpm@selenic.com>
parents: 21920
diff changeset
   187
  <<<<<<< local
21920
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   188
  1
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   189
  2
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   190
  3
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   191
  6
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   192
  8
11797
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
   193
  =======
21921
ecc1387138ba filemerge: use non-minimal conflict marker regions (BC)
Matt Mackall <mpm@selenic.com>
parents: 21920
diff changeset
   194
  1
ecc1387138ba filemerge: use non-minimal conflict marker regions (BC)
Matt Mackall <mpm@selenic.com>
parents: 21920
diff changeset
   195
  2
ecc1387138ba filemerge: use non-minimal conflict marker regions (BC)
Matt Mackall <mpm@selenic.com>
parents: 21920
diff changeset
   196
  3
21920
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   197
  4
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   198
  5
11797
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
   199
  >>>>>>> other
21920
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   200
  Hop we are done.
22028
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   201
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   202
internal:merge3
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   203
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   204
  $ hg up -q --clean .
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   205
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   206
  $ hg merge 1 --tool internal:merge3
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   207
  merging a
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   208
  warning: conflicts during merge.
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   209
  merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   210
  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   211
  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   212
  [1]
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   213
  $ cat a
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   214
  Small Mathematical Series.
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   215
  <<<<<<< local
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   216
  1
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   217
  2
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   218
  3
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   219
  6
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   220
  8
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   221
  ||||||| base
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   222
  One
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   223
  Two
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   224
  Three
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   225
  Four
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   226
  Five
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   227
  =======
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   228
  1
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   229
  2
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   230
  3
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   231
  4
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   232
  5
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   233
  >>>>>>> other
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   234
  Hop we are done.