annotate tests/test-merge-partial-tool.t @ 49123:afe60def963d

rust-dirstatemap: use `DirstateEntry::tracked` directly `state()` is a legacy API that will be removed at some point, let's use the newer API. Differential Revision: https://phab.mercurial-scm.org/D12521
author Raphaël Gomès <rgomes@octobus.net>
date Tue, 29 Mar 2022 17:23:24 +0200
parents 9dfbea54b680
children 7af798e497f5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
48981
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
1 Test support for partial-resolution tools
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
2
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
3 Create a tool that resolves conflicts after line 5 by simply dropping those
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
4 lines (even if there are no conflicts there)
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
5 $ cat >> "$TESTTMP/head.sh" <<'EOF'
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
6 > #!/bin/sh
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
7 > for f in "$@"; do
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
8 > head -5 $f > tmp
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
9 > mv -f tmp $f
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
10 > done
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
11 > EOF
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
12 $ chmod +x "$TESTTMP/head.sh"
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
13 ...and another tool that keeps only the last 5 lines instead of the first 5.
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
14 $ cat >> "$TESTTMP/tail.sh" <<'EOF'
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
15 > #!/bin/sh
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
16 > for f in "$@"; do
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
17 > tail -5 $f > tmp
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
18 > mv -f tmp $f
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
19 > done
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
20 > EOF
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
21 $ chmod +x "$TESTTMP/tail.sh"
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
22
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
23 Set up both tools to run on all patterns (the default), and let the `tail` tool
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
24 run after the `head` tool, which means it will have no effect (we'll override it
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
25 to test order later)
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
26 $ cat >> "$HGRCPATH" <<EOF
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
27 > [partial-merge-tools]
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
28 > head.executable=$TESTTMP/head.sh
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
29 > tail.executable=$TESTTMP/tail.sh
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
30 > tail.order=1
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
31 > EOF
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
32
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
33 $ make_commit() {
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
34 > echo "$@" | xargs -n1 > file
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
35 > hg add file 2> /dev/null
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
36 > hg ci -m "$*"
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
37 > }
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
38
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
39
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
40 Let a partial-resolution tool resolve some conflicts and leave other conflicts
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
41 for the regular merge tool (:merge3 here)
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
42
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
43 $ hg init repo
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
44 $ cd repo
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
45 $ make_commit a b c d e f
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
46 $ make_commit a b2 c d e f2
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
47 $ hg up 0
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
48 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
49 $ make_commit a b3 c d e f3
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
50 created new head
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
51 $ hg merge 1 -t :merge3
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
52 merging file
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
53 warning: conflicts while merging file! (edit, then use 'hg resolve --mark')
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
54 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
55 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
56 [1]
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
57 $ cat file
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
58 a
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
59 <<<<<<< working copy: e11a49d4b620 - test: a b3 c d e f3
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
60 b3
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
61 ||||||| common ancestor: 8ae8bb9cc43a - test: a b c d e f
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
62 b
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
63 =======
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
64 b2
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
65 >>>>>>> merge rev: fbc096a40cc5 - test: a b2 c d e f2
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
66 c
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
67 d
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
68 e
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
69
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
70
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
71 With premerge=keep, the partial-resolution tools runs before and doesn't see
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
72 the conflict markers
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
73
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
74 $ hg up -C 2
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
75 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
76 $ cat >> .hg/hgrc <<EOF
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
77 > [merge-tools]
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
78 > my-local.executable = cat
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
79 > my-local.args = $local
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
80 > my-local.premerge = keep-merge3
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
81 > EOF
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
82 $ hg merge 1 -t my-local
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
83 merging file
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
84 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
85 (branch merge, don't forget to commit)
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
86 $ cat file
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
87 a
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
88 <<<<<<< working copy: e11a49d4b620 - test: a b3 c d e f3
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
89 b3
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
90 ||||||| common ancestor: 8ae8bb9cc43a - test: a b c d e f
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
91 b
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
92 =======
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
93 b2
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
94 >>>>>>> merge rev: fbc096a40cc5 - test: a b2 c d e f2
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
95 c
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
96 d
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
97 e
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
98
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
99
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
100 When a partial-resolution tool resolves all conflicts, the resolution should
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
101 be recorded and the regular merge tool should not be invoked for the file.
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
102
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
103 $ hg up -C 0
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
104 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
105 $ make_commit a b c d e f2
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
106 created new head
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
107 $ hg up 0
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
108 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
109 $ make_commit a b c d e f3
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
110 created new head
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
111 $ hg merge 3 -t false
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
112 merging file
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
113 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
114 (branch merge, don't forget to commit)
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
115 $ cat file
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
116 a
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
117 b
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
118 c
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
119 d
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
120 e
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
121
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
122
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
123 Only tools whose patterns match are run. We make `head` not match here, so
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
124 only `tail` should run
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
125
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
126 $ hg up -C 4
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
127 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
128 $ hg merge 3 -t :merge3 --config partial-merge-tools.head.patterns=other
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
129 merging file
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
130 warning: conflicts while merging file! (edit, then use 'hg resolve --mark')
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
131 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
132 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
133 [1]
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
134 $ cat file
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
135 b
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
136 c
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
137 d
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
138 e
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
139 <<<<<<< working copy: d57edaa6e21a - test: a b c d e f3
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
140 f3
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
141 ||||||| common ancestor: 8ae8bb9cc43a - test: a b c d e f
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
142 f
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
143 =======
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
144 f2
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
145 >>>>>>> merge rev: 8c217da987be - test: a b c d e f2
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
146
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
147
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
148 If there are several matching tools, they are run in requested order. We move
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
149 `head` after `tail` in order here so it has no effect (the conflict in "f" thus
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
150 remains).
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
151
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
152 $ hg up -C 4
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
153 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
154 $ hg merge 3 -t :merge3 --config partial-merge-tools.head.order=2
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
155 merging file
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
156 warning: conflicts while merging file! (edit, then use 'hg resolve --mark')
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
157 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
158 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
159 [1]
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
160 $ cat file
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
161 b
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
162 c
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
163 d
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
164 e
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
165 <<<<<<< working copy: d57edaa6e21a - test: a b c d e f3
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
166 f3
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
167 ||||||| common ancestor: 8ae8bb9cc43a - test: a b c d e f
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
168 f
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
169 =======
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
170 f2
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
171 >>>>>>> merge rev: 8c217da987be - test: a b c d e f2
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
172
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
173
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
174 When using "nomerge" tools (e.g. `:other`), the partial-resolution tools
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
175 should not be run.
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
176
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
177 $ hg up -C 4
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
178 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
179 $ hg merge 3 -t :other
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
180 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
181 (branch merge, don't forget to commit)
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
182 $ cat file
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
183 a
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
184 b
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
185 c
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
186 d
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
187 e
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
188 f2
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
189
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
190
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
191 If a partial-resolution tool resolved some conflict and simplemerge can
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
192 merge the rest, then the regular merge tool should not be used. Here we merge
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
193 "a b c d e3 f3" with "a b2 c d e f2". The `head` tool resolves the conflict in
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
194 "f" and the internal simplemerge merges the remaining changes in "b" and "e".
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
195
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
196 $ hg up -C 0
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
197 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
198 $ make_commit a b c d e3 f3
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
199 created new head
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
200 $ hg merge 1 -t false
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
201 merging file
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
202 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
203 (branch merge, don't forget to commit)
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
204 $ cat file
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
205 a
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
206 b2
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
207 c
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
208 d
f3aafd785e65 filemerge: add support for partial conflict resolution by external tool
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
209 e3
48982
9dfbea54b680 partial-merge: add support for `.args` config (`$local` etc.)
Martin von Zweigbergk <martinvonz@google.com>
parents: 48981
diff changeset
210
9dfbea54b680 partial-merge: add support for `.args` config (`$local` etc.)
Martin von Zweigbergk <martinvonz@google.com>
parents: 48981
diff changeset
211 Test that arguments get passed as expected.
9dfbea54b680 partial-merge: add support for `.args` config (`$local` etc.)
Martin von Zweigbergk <martinvonz@google.com>
parents: 48981
diff changeset
212
9dfbea54b680 partial-merge: add support for `.args` config (`$local` etc.)
Martin von Zweigbergk <martinvonz@google.com>
parents: 48981
diff changeset
213 $ cat >> "$TESTTMP/log-args.sh" <<'EOF'
9dfbea54b680 partial-merge: add support for `.args` config (`$local` etc.)
Martin von Zweigbergk <martinvonz@google.com>
parents: 48981
diff changeset
214 > #!/bin/sh
9dfbea54b680 partial-merge: add support for `.args` config (`$local` etc.)
Martin von Zweigbergk <martinvonz@google.com>
parents: 48981
diff changeset
215 > echo "$@" > args.log
9dfbea54b680 partial-merge: add support for `.args` config (`$local` etc.)
Martin von Zweigbergk <martinvonz@google.com>
parents: 48981
diff changeset
216 > EOF
9dfbea54b680 partial-merge: add support for `.args` config (`$local` etc.)
Martin von Zweigbergk <martinvonz@google.com>
parents: 48981
diff changeset
217 $ chmod +x "$TESTTMP/log-args.sh"
9dfbea54b680 partial-merge: add support for `.args` config (`$local` etc.)
Martin von Zweigbergk <martinvonz@google.com>
parents: 48981
diff changeset
218 $ cat >> "$HGRCPATH" <<EOF
9dfbea54b680 partial-merge: add support for `.args` config (`$local` etc.)
Martin von Zweigbergk <martinvonz@google.com>
parents: 48981
diff changeset
219 > [partial-merge-tools]
9dfbea54b680 partial-merge: add support for `.args` config (`$local` etc.)
Martin von Zweigbergk <martinvonz@google.com>
parents: 48981
diff changeset
220 > log-args.executable=$TESTTMP/log-args.sh
9dfbea54b680 partial-merge: add support for `.args` config (`$local` etc.)
Martin von Zweigbergk <martinvonz@google.com>
parents: 48981
diff changeset
221 > EOF
9dfbea54b680 partial-merge: add support for `.args` config (`$local` etc.)
Martin von Zweigbergk <martinvonz@google.com>
parents: 48981
diff changeset
222 $ hg up -C 2
9dfbea54b680 partial-merge: add support for `.args` config (`$local` etc.)
Martin von Zweigbergk <martinvonz@google.com>
parents: 48981
diff changeset
223 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
9dfbea54b680 partial-merge: add support for `.args` config (`$local` etc.)
Martin von Zweigbergk <martinvonz@google.com>
parents: 48981
diff changeset
224 $ hg merge 1
9dfbea54b680 partial-merge: add support for `.args` config (`$local` etc.)
Martin von Zweigbergk <martinvonz@google.com>
parents: 48981
diff changeset
225 merging file
9dfbea54b680 partial-merge: add support for `.args` config (`$local` etc.)
Martin von Zweigbergk <martinvonz@google.com>
parents: 48981
diff changeset
226 warning: conflicts while merging file! (edit, then use 'hg resolve --mark')
9dfbea54b680 partial-merge: add support for `.args` config (`$local` etc.)
Martin von Zweigbergk <martinvonz@google.com>
parents: 48981
diff changeset
227 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
9dfbea54b680 partial-merge: add support for `.args` config (`$local` etc.)
Martin von Zweigbergk <martinvonz@google.com>
parents: 48981
diff changeset
228 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
9dfbea54b680 partial-merge: add support for `.args` config (`$local` etc.)
Martin von Zweigbergk <martinvonz@google.com>
parents: 48981
diff changeset
229 [1]
9dfbea54b680 partial-merge: add support for `.args` config (`$local` etc.)
Martin von Zweigbergk <martinvonz@google.com>
parents: 48981
diff changeset
230 $ cat args.log
9dfbea54b680 partial-merge: add support for `.args` config (`$local` etc.)
Martin von Zweigbergk <martinvonz@google.com>
parents: 48981
diff changeset
231 */hgmerge-*/file~local */hgmerge-*/file~base */hgmerge-*/file~other (glob)
9dfbea54b680 partial-merge: add support for `.args` config (`$local` etc.)
Martin von Zweigbergk <martinvonz@google.com>
parents: 48981
diff changeset
232 $ hg up -C 2
9dfbea54b680 partial-merge: add support for `.args` config (`$local` etc.)
Martin von Zweigbergk <martinvonz@google.com>
parents: 48981
diff changeset
233 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
9dfbea54b680 partial-merge: add support for `.args` config (`$local` etc.)
Martin von Zweigbergk <martinvonz@google.com>
parents: 48981
diff changeset
234 $ hg merge 1 --config partial-merge-tools.log-args.args='--other $other $base --foo --local $local --also-other $other'
9dfbea54b680 partial-merge: add support for `.args` config (`$local` etc.)
Martin von Zweigbergk <martinvonz@google.com>
parents: 48981
diff changeset
235 merging file
9dfbea54b680 partial-merge: add support for `.args` config (`$local` etc.)
Martin von Zweigbergk <martinvonz@google.com>
parents: 48981
diff changeset
236 warning: conflicts while merging file! (edit, then use 'hg resolve --mark')
9dfbea54b680 partial-merge: add support for `.args` config (`$local` etc.)
Martin von Zweigbergk <martinvonz@google.com>
parents: 48981
diff changeset
237 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
9dfbea54b680 partial-merge: add support for `.args` config (`$local` etc.)
Martin von Zweigbergk <martinvonz@google.com>
parents: 48981
diff changeset
238 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
9dfbea54b680 partial-merge: add support for `.args` config (`$local` etc.)
Martin von Zweigbergk <martinvonz@google.com>
parents: 48981
diff changeset
239 [1]
9dfbea54b680 partial-merge: add support for `.args` config (`$local` etc.)
Martin von Zweigbergk <martinvonz@google.com>
parents: 48981
diff changeset
240 $ cat args.log
9dfbea54b680 partial-merge: add support for `.args` config (`$local` etc.)
Martin von Zweigbergk <martinvonz@google.com>
parents: 48981
diff changeset
241 --other */hgmerge-*/file~other */hgmerge-*/file~base --foo --local */hgmerge-*/file~local --also-other */hgmerge-*/file~other (glob)