tests/test-conflict.t
author Martin von Zweigbergk <martinvonz@google.com>
Fri, 30 Oct 2020 13:26:18 -0700
changeset 45866 996cd73431a3
parent 45767 40411ad2f5d2
child 46077 7a2b67e6b680
permissions -rw-r--r--
help: document the new [command-templates] config section Differential Revision: https://phab.mercurial-scm.org/D9265
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
26614
ef1eb6df7071 simplemerge: move conflict warning message to filemerge
Siddharth Agarwal <sid0@fb.com>
parents: 26224
diff changeset
    39
  warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
11797
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
    40
  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
35704
41ef02ba329b merge: add `--abort` flag which can abort the merge
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33771
diff changeset
    41
  use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12314
diff changeset
    42
  [1]
11797
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
    43
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
    44
  $ 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
    45
  618808747361+c0c68e4fe667+ tip
11797
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
    46
33771
96f43981c1c4 morestatus: move fb extension to core by plugging to `hg status --verbose`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33262
diff changeset
    47
  $ echo "[commands]" >> $HGRCPATH
96f43981c1c4 morestatus: move fb extension to core by plugging to `hg status --verbose`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33262
diff changeset
    48
  $ echo "status.verbose=true" >> $HGRCPATH
96f43981c1c4 morestatus: move fb extension to core by plugging to `hg status --verbose`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33262
diff changeset
    49
  $ hg status
96f43981c1c4 morestatus: move fb extension to core by plugging to `hg status --verbose`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33262
diff changeset
    50
  M a
96f43981c1c4 morestatus: move fb extension to core by plugging to `hg status --verbose`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33262
diff changeset
    51
  ? a.orig
96f43981c1c4 morestatus: move fb extension to core by plugging to `hg status --verbose`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33262
diff changeset
    52
  # The repository is in an unfinished *merge* state.
96f43981c1c4 morestatus: move fb extension to core by plugging to `hg status --verbose`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33262
diff changeset
    53
  
96f43981c1c4 morestatus: move fb extension to core by plugging to `hg status --verbose`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33262
diff changeset
    54
  # Unresolved merge conflicts:
96f43981c1c4 morestatus: move fb extension to core by plugging to `hg status --verbose`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33262
diff changeset
    55
  # 
96f43981c1c4 morestatus: move fb extension to core by plugging to `hg status --verbose`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33262
diff changeset
    56
  #     a
96f43981c1c4 morestatus: move fb extension to core by plugging to `hg status --verbose`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33262
diff changeset
    57
  # 
96f43981c1c4 morestatus: move fb extension to core by plugging to `hg status --verbose`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33262
diff changeset
    58
  # To mark files as resolved:  hg resolve --mark FILE
96f43981c1c4 morestatus: move fb extension to core by plugging to `hg status --verbose`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33262
diff changeset
    59
  
38341
50f5fc232c16 morestatus: remove some extra spaces
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35949
diff changeset
    60
  # To continue:    hg commit
38965
cf68e2649e0a status: advertise --abort instead of 'update -C .' to abort a merge
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 38341
diff changeset
    61
  # To abort:       hg merge --abort
33771
96f43981c1c4 morestatus: move fb extension to core by plugging to `hg status --verbose`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33262
diff changeset
    62
  
39736
e7ae31199ff9 tests: show that the structure of the more status output looks weird
Yuya Nishihara <yuya@tcha.org>
parents: 39707
diff changeset
    63
  $ hg status -Tjson
e7ae31199ff9 tests: show that the structure of the more status output looks weird
Yuya Nishihara <yuya@tcha.org>
parents: 39707
diff changeset
    64
  [
e7ae31199ff9 tests: show that the structure of the more status output looks weird
Yuya Nishihara <yuya@tcha.org>
parents: 39707
diff changeset
    65
   {
43861
aac921f54554 status: outputting structured unfinished-operation information
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents: 43842
diff changeset
    66
    "itemtype": "file",
39736
e7ae31199ff9 tests: show that the structure of the more status output looks weird
Yuya Nishihara <yuya@tcha.org>
parents: 39707
diff changeset
    67
    "path": "a",
43842
7315464f0613 status: add template/json data about whether a file has unresolved conflicts
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents: 39737
diff changeset
    68
    "status": "M",
7315464f0613 status: add template/json data about whether a file has unresolved conflicts
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents: 39737
diff changeset
    69
    "unresolved": true
39736
e7ae31199ff9 tests: show that the structure of the more status output looks weird
Yuya Nishihara <yuya@tcha.org>
parents: 39707
diff changeset
    70
   },
e7ae31199ff9 tests: show that the structure of the more status output looks weird
Yuya Nishihara <yuya@tcha.org>
parents: 39707
diff changeset
    71
   {
43861
aac921f54554 status: outputting structured unfinished-operation information
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents: 43842
diff changeset
    72
    "itemtype": "file",
39736
e7ae31199ff9 tests: show that the structure of the more status output looks weird
Yuya Nishihara <yuya@tcha.org>
parents: 39707
diff changeset
    73
    "path": "a.orig",
e7ae31199ff9 tests: show that the structure of the more status output looks weird
Yuya Nishihara <yuya@tcha.org>
parents: 39707
diff changeset
    74
    "status": "?"
43861
aac921f54554 status: outputting structured unfinished-operation information
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents: 43842
diff changeset
    75
   },
aac921f54554 status: outputting structured unfinished-operation information
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents: 43842
diff changeset
    76
   {
aac921f54554 status: outputting structured unfinished-operation information
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents: 43842
diff changeset
    77
    "itemtype": "morestatus",
aac921f54554 status: outputting structured unfinished-operation information
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents: 43842
diff changeset
    78
    "unfinished": "merge",
aac921f54554 status: outputting structured unfinished-operation information
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents: 43842
diff changeset
    79
    "unfinishedmsg": "To continue:    hg commit\nTo abort:       hg merge --abort"
39736
e7ae31199ff9 tests: show that the structure of the more status output looks weird
Yuya Nishihara <yuya@tcha.org>
parents: 39707
diff changeset
    80
   }
e7ae31199ff9 tests: show that the structure of the more status output looks weird
Yuya Nishihara <yuya@tcha.org>
parents: 39707
diff changeset
    81
  ]
33771
96f43981c1c4 morestatus: move fb extension to core by plugging to `hg status --verbose`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33262
diff changeset
    82
11797
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
    83
  $ 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
    84
  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
    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
30062
940c05b25b07 merge: add conflict labels to merge command
Simon Farnsworth <simonfar@fb.com>
parents: 28072
diff changeset
    88
  <<<<<<< working copy: 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
    89
  6
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    90
  8
21519
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
    91
  =======
21920
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    92
  4
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    93
  5
30460
ce3a133f71b3 conflicts: make spacing consistent in conflict markers
Kostia Balytskyi <ikostia@fb.com>
parents: 30062
diff changeset
    94
  >>>>>>> merge rev:    c0c68e4fe667 - test: branch1
21920
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
    95
  Hop we are done.
21519
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
    96
33771
96f43981c1c4 morestatus: move fb extension to core by plugging to `hg status --verbose`
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33262
diff changeset
    97
  $ hg status --config commands.status.verbose=0
21519
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
    98
  M a
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
    99
  ? a.orig
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
   100
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
   101
Verify custom conflict markers
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
   102
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
   103
  $ hg up -q --clean .
32047
458f7294dfee filemerge: optionally strip quotes from merge marker template (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 30460
diff changeset
   104
  $ cat <<EOF >> .hg/hgrc
45767
40411ad2f5d2 config: rename ui.mergemarkertemplate to command-templates.mergemarker
Martin von Zweigbergk <martinvonz@google.com>
parents: 43861
diff changeset
   105
  > [command-templates]
40411ad2f5d2 config: rename ui.mergemarkertemplate to command-templates.mergemarker
Martin von Zweigbergk <martinvonz@google.com>
parents: 43861
diff changeset
   106
  > mergemarker = '{author} {rev}'
40411ad2f5d2 config: rename ui.mergemarkertemplate to command-templates.mergemarker
Martin von Zweigbergk <martinvonz@google.com>
parents: 43861
diff changeset
   107
  > EOF
40411ad2f5d2 config: rename ui.mergemarkertemplate to command-templates.mergemarker
Martin von Zweigbergk <martinvonz@google.com>
parents: 43861
diff changeset
   108
40411ad2f5d2 config: rename ui.mergemarkertemplate to command-templates.mergemarker
Martin von Zweigbergk <martinvonz@google.com>
parents: 43861
diff changeset
   109
  $ hg merge 1
40411ad2f5d2 config: rename ui.mergemarkertemplate to command-templates.mergemarker
Martin von Zweigbergk <martinvonz@google.com>
parents: 43861
diff changeset
   110
  merging a
40411ad2f5d2 config: rename ui.mergemarkertemplate to command-templates.mergemarker
Martin von Zweigbergk <martinvonz@google.com>
parents: 43861
diff changeset
   111
  warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
40411ad2f5d2 config: rename ui.mergemarkertemplate to command-templates.mergemarker
Martin von Zweigbergk <martinvonz@google.com>
parents: 43861
diff changeset
   112
  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
40411ad2f5d2 config: rename ui.mergemarkertemplate to command-templates.mergemarker
Martin von Zweigbergk <martinvonz@google.com>
parents: 43861
diff changeset
   113
  use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
40411ad2f5d2 config: rename ui.mergemarkertemplate to command-templates.mergemarker
Martin von Zweigbergk <martinvonz@google.com>
parents: 43861
diff changeset
   114
  [1]
40411ad2f5d2 config: rename ui.mergemarkertemplate to command-templates.mergemarker
Martin von Zweigbergk <martinvonz@google.com>
parents: 43861
diff changeset
   115
40411ad2f5d2 config: rename ui.mergemarkertemplate to command-templates.mergemarker
Martin von Zweigbergk <martinvonz@google.com>
parents: 43861
diff changeset
   116
  $ cat a
40411ad2f5d2 config: rename ui.mergemarkertemplate to command-templates.mergemarker
Martin von Zweigbergk <martinvonz@google.com>
parents: 43861
diff changeset
   117
  Small Mathematical Series.
40411ad2f5d2 config: rename ui.mergemarkertemplate to command-templates.mergemarker
Martin von Zweigbergk <martinvonz@google.com>
parents: 43861
diff changeset
   118
  1
40411ad2f5d2 config: rename ui.mergemarkertemplate to command-templates.mergemarker
Martin von Zweigbergk <martinvonz@google.com>
parents: 43861
diff changeset
   119
  2
40411ad2f5d2 config: rename ui.mergemarkertemplate to command-templates.mergemarker
Martin von Zweigbergk <martinvonz@google.com>
parents: 43861
diff changeset
   120
  3
40411ad2f5d2 config: rename ui.mergemarkertemplate to command-templates.mergemarker
Martin von Zweigbergk <martinvonz@google.com>
parents: 43861
diff changeset
   121
  <<<<<<< working copy: test 2
40411ad2f5d2 config: rename ui.mergemarkertemplate to command-templates.mergemarker
Martin von Zweigbergk <martinvonz@google.com>
parents: 43861
diff changeset
   122
  6
40411ad2f5d2 config: rename ui.mergemarkertemplate to command-templates.mergemarker
Martin von Zweigbergk <martinvonz@google.com>
parents: 43861
diff changeset
   123
  8
40411ad2f5d2 config: rename ui.mergemarkertemplate to command-templates.mergemarker
Martin von Zweigbergk <martinvonz@google.com>
parents: 43861
diff changeset
   124
  =======
40411ad2f5d2 config: rename ui.mergemarkertemplate to command-templates.mergemarker
Martin von Zweigbergk <martinvonz@google.com>
parents: 43861
diff changeset
   125
  4
40411ad2f5d2 config: rename ui.mergemarkertemplate to command-templates.mergemarker
Martin von Zweigbergk <martinvonz@google.com>
parents: 43861
diff changeset
   126
  5
40411ad2f5d2 config: rename ui.mergemarkertemplate to command-templates.mergemarker
Martin von Zweigbergk <martinvonz@google.com>
parents: 43861
diff changeset
   127
  >>>>>>> merge rev:    test 1
40411ad2f5d2 config: rename ui.mergemarkertemplate to command-templates.mergemarker
Martin von Zweigbergk <martinvonz@google.com>
parents: 43861
diff changeset
   128
  Hop we are done.
40411ad2f5d2 config: rename ui.mergemarkertemplate to command-templates.mergemarker
Martin von Zweigbergk <martinvonz@google.com>
parents: 43861
diff changeset
   129
40411ad2f5d2 config: rename ui.mergemarkertemplate to command-templates.mergemarker
Martin von Zweigbergk <martinvonz@google.com>
parents: 43861
diff changeset
   130
Verify custom conflict markers with legacy config name
40411ad2f5d2 config: rename ui.mergemarkertemplate to command-templates.mergemarker
Martin von Zweigbergk <martinvonz@google.com>
parents: 43861
diff changeset
   131
40411ad2f5d2 config: rename ui.mergemarkertemplate to command-templates.mergemarker
Martin von Zweigbergk <martinvonz@google.com>
parents: 43861
diff changeset
   132
  $ hg up -q --clean .
40411ad2f5d2 config: rename ui.mergemarkertemplate to command-templates.mergemarker
Martin von Zweigbergk <martinvonz@google.com>
parents: 43861
diff changeset
   133
  $ cat <<EOF >> .hg/hgrc
32047
458f7294dfee filemerge: optionally strip quotes from merge marker template (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 30460
diff changeset
   134
  > [ui]
458f7294dfee filemerge: optionally strip quotes from merge marker template (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 30460
diff changeset
   135
  > mergemarkertemplate = '{author} {rev}'
458f7294dfee filemerge: optionally strip quotes from merge marker template (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 30460
diff changeset
   136
  > EOF
21519
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
   137
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
   138
  $ hg merge 1
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
   139
  merging a
26614
ef1eb6df7071 simplemerge: move conflict warning message to filemerge
Siddharth Agarwal <sid0@fb.com>
parents: 26224
diff changeset
   140
  warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
21519
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
   141
  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
35704
41ef02ba329b merge: add `--abort` flag which can abort the merge
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33771
diff changeset
   142
  use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
21519
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
   143
  [1]
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
   144
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
   145
  $ 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
   146
  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
   147
  1
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   148
  2
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   149
  3
30062
940c05b25b07 merge: add conflict labels to merge command
Simon Farnsworth <simonfar@fb.com>
parents: 28072
diff changeset
   150
  <<<<<<< working copy: 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
   151
  6
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   152
  8
21519
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
   153
  =======
21920
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   154
  4
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   155
  5
30062
940c05b25b07 merge: add conflict labels to merge command
Simon Farnsworth <simonfar@fb.com>
parents: 28072
diff changeset
   156
  >>>>>>> merge rev:    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
   157
  Hop we are done.
21519
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
   158
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
   159
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
   160
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
   161
  $ 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
   162
  $ cat >> .hg/hgrc <<EOF
45767
40411ad2f5d2 config: rename ui.mergemarkertemplate to command-templates.mergemarker
Martin von Zweigbergk <martinvonz@google.com>
parents: 43861
diff changeset
   163
  > [command-templates]
40411ad2f5d2 config: rename ui.mergemarkertemplate to command-templates.mergemarker
Martin von Zweigbergk <martinvonz@google.com>
parents: 43861
diff changeset
   164
  > mergemarker={author} {rev}\nfoo\nbar\nbaz
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
   165
  > 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
   166
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
   167
  $ hg -q merge 1
26614
ef1eb6df7071 simplemerge: move conflict warning message to filemerge
Siddharth Agarwal <sid0@fb.com>
parents: 26224
diff changeset
   168
  warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
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
   169
  [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
   170
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
   171
  $ 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
   172
  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
   173
  1
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   174
  2
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   175
  3
30062
940c05b25b07 merge: add conflict labels to merge command
Simon Farnsworth <simonfar@fb.com>
parents: 28072
diff changeset
   176
  <<<<<<< working copy: 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
   177
  6
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   178
  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
   179
  =======
21920
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   180
  4
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   181
  5
30062
940c05b25b07 merge: add conflict labels to merge command
Simon Farnsworth <simonfar@fb.com>
parents: 28072
diff changeset
   182
  >>>>>>> merge rev:    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
   183
  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
   184
21865
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   185
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
   186
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   187
  $ hg up -q --clean .
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 38965
diff changeset
   188
  $ "$PYTHON" <<EOF
35949
80e5210df25c py3: make sure we open the file in bytes mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35947
diff changeset
   189
  > fp = open('logfile', 'wb')
35947
a36d3c8a0e41 py3: add b'' prefixes to string literals in test files
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35704
diff changeset
   190
  > fp.write(b'12345678901234567890123456789012345678901234567890' +
a36d3c8a0e41 py3: add b'' prefixes to string literals in test files
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35704
diff changeset
   191
  >          b'1234567890') # there are 5 more columns for 80 columns
21865
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   192
  > 
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   193
  > # 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
   194
  > 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
   195
  > 
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   196
  > fp.close()
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   197
  > EOF
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   198
  $ 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
   199
  $ 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
   200
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   201
  $ cat >> .hg/hgrc <<EOF
45767
40411ad2f5d2 config: rename ui.mergemarkertemplate to command-templates.mergemarker
Martin von Zweigbergk <martinvonz@google.com>
parents: 43861
diff changeset
   202
  > [command-templates]
40411ad2f5d2 config: rename ui.mergemarkertemplate to command-templates.mergemarker
Martin von Zweigbergk <martinvonz@google.com>
parents: 43861
diff changeset
   203
  > mergemarker={desc|firstline}
21865
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   204
  > EOF
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   205
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   206
  $ hg -q --encoding utf-8 merge 1
26614
ef1eb6df7071 simplemerge: move conflict warning message to filemerge
Siddharth Agarwal <sid0@fb.com>
parents: 26224
diff changeset
   207
  warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
21865
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   208
  [1]
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   209
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   210
  $ 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
   211
  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
   212
  1
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   213
  2
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   214
  3
30062
940c05b25b07 merge: add conflict labels to merge command
Simon Farnsworth <simonfar@fb.com>
parents: 28072
diff changeset
   215
  <<<<<<< working copy: 1234567890123456789012345678901234567890123456789012345...
21920
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   216
  6
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   217
  8
21865
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   218
  =======
21920
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   219
  4
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   220
  5
30062
940c05b25b07 merge: add conflict labels to merge command
Simon Farnsworth <simonfar@fb.com>
parents: 28072
diff changeset
   221
  >>>>>>> merge rev:    branch1
21920
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   222
  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
   223
21519
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
   224
Verify basic conflict markers
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
   225
21865
78e56e70c70a filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21864
diff changeset
   226
  $ hg up -q --clean 2
21519
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
   227
  $ printf "\n[ui]\nmergemarkers=basic\n" >> .hg/hgrc
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
   228
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
   229
  $ hg merge 1
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
   230
  merging a
26614
ef1eb6df7071 simplemerge: move conflict warning message to filemerge
Siddharth Agarwal <sid0@fb.com>
parents: 26224
diff changeset
   231
  warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
21519
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
   232
  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
35704
41ef02ba329b merge: add `--abort` flag which can abort the merge
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33771
diff changeset
   233
  use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
21519
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
   234
  [1]
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
   235
25d5a9ecbb85 merge: add conflict marker formatter (BC)
Durham Goode <durham@fb.com>
parents: 15501
diff changeset
   236
  $ 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
   237
  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
   238
  1
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   239
  2
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   240
  3
30062
940c05b25b07 merge: add conflict labels to merge command
Simon Farnsworth <simonfar@fb.com>
parents: 28072
diff changeset
   241
  <<<<<<< working copy
21920
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   242
  6
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   243
  8
11797
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
   244
  =======
21920
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   245
  4
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   246
  5
30062
940c05b25b07 merge: add conflict labels to merge command
Simon Farnsworth <simonfar@fb.com>
parents: 28072
diff changeset
   247
  >>>>>>> merge rev
21920
1d04d3fe616d test: use more elaborated content in ``test-conflict.t``
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21865
diff changeset
   248
  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
   249
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   250
internal:merge3
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   251
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   252
  $ hg up -q --clean .
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   253
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   254
  $ 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
   255
  merging a
26614
ef1eb6df7071 simplemerge: move conflict warning message to filemerge
Siddharth Agarwal <sid0@fb.com>
parents: 26224
diff changeset
   256
  warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
22028
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   257
  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
35704
41ef02ba329b merge: add `--abort` flag which can abort the merge
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33771
diff changeset
   258
  use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
22028
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   259
  [1]
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   260
  $ cat a
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   261
  Small Mathematical Series.
30062
940c05b25b07 merge: add conflict labels to merge command
Simon Farnsworth <simonfar@fb.com>
parents: 28072
diff changeset
   262
  <<<<<<< working copy
22028
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   263
  1
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   264
  2
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   265
  3
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   266
  6
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   267
  8
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   268
  ||||||| base
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   269
  One
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   270
  Two
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   271
  Three
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   272
  Four
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   273
  Five
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   274
  =======
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   275
  1
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   276
  2
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   277
  3
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   278
  4
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   279
  5
30062
940c05b25b07 merge: add conflict labels to merge command
Simon Farnsworth <simonfar@fb.com>
parents: 28072
diff changeset
   280
  >>>>>>> merge rev
22028
3d0572ab3b4a merge: add an internal:merge3 tool
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 21921
diff changeset
   281
  Hop we are done.
26224
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   282
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   283
Add some unconflicting changes on each head, to make sure we really
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   284
are merging, unlike :local and :other
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   285
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   286
  $ hg up -C
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   287
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
32698
1b5c61d38a52 update: show the commit to which we updated in case of multiple heads (BC)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32047
diff changeset
   288
  updated to "e0693e20f496: 123456789012345678901234567890123456789012345678901234567890????"
28029
72072cfc7e91 update: warn about other topological heads on bare update
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26614
diff changeset
   289
  1 other heads for branch "default"
26224
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   290
  $ printf "\n\nEnd of file\n" >> a
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   291
  $ hg ci -m "Add some stuff at the end"
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   292
  $ hg up -r 1
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   293
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   294
  $ printf "Start of file\n\n\n" > tmp
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   295
  $ cat a >> tmp
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   296
  $ mv tmp a
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   297
  $ hg ci -m "Add some stuff at the beginning"
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   298
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   299
Now test :merge-other and :merge-local
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   300
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   301
  $ hg merge
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   302
  merging a
26614
ef1eb6df7071 simplemerge: move conflict warning message to filemerge
Siddharth Agarwal <sid0@fb.com>
parents: 26224
diff changeset
   303
  warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
26224
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   304
  1 files updated, 0 files merged, 0 files removed, 1 files unresolved
35704
41ef02ba329b merge: add `--abort` flag which can abort the merge
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33771
diff changeset
   305
  use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
26224
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   306
  [1]
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   307
  $ hg resolve --tool :merge-other a
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   308
  merging a
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   309
  (no more unresolved files)
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   310
  $ cat a
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   311
  Start of file
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   312
  
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   313
  
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   314
  Small Mathematical Series.
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   315
  1
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   316
  2
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   317
  3
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   318
  6
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   319
  8
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   320
  Hop we are done.
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   321
  
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   322
  
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   323
  End of file
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   324
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   325
  $ hg up -C
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   326
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
32698
1b5c61d38a52 update: show the commit to which we updated in case of multiple heads (BC)
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32047
diff changeset
   327
  updated to "18b51d585961: Add some stuff at the beginning"
28029
72072cfc7e91 update: warn about other topological heads on bare update
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26614
diff changeset
   328
  1 other heads for branch "default"
26224
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   329
  $ hg merge --tool :merge-local
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   330
  merging a
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   331
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   332
  (branch merge, don't forget to commit)
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   333
  $ cat a
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   334
  Start of file
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   335
  
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   336
  
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   337
  Small Mathematical Series.
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   338
  1
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   339
  2
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   340
  3
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   341
  4
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   342
  5
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   343
  Hop we are done.
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   344
  
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   345
  
a4da463df6cf filemerge: add non-interactive :merge-local and :merge-other
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22028
diff changeset
   346
  End of file