Mercurial > hg
annotate tests/test-diff-change.t @ 46448:1a7d12c82057
diff: add experimental support for "merge diffs"
The way this works is it re-runs the merge and "stores" conflicts, and then
diffs against the conflicted result. In a normal merge, you should only see
diffs against conflicted regions or in cases where there was a semantic
conflict but not a textual one. This makes it easier to detect "evil merges"
that contain substantial new work embedded in the merge commit.
Differential Revision: https://phab.mercurial-scm.org/D8504
author | Augie Fackler <augie@google.com> |
---|---|
date | Thu, 07 May 2020 16:50:26 -0400 |
parents | 64292addbe67 |
children | 62a0b5daa15f |
rev | line source |
---|---|
46087
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
1 Testing diff --change, --from, --to |
7628
9c6ae2e09e11
diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff
changeset
|
2 |
12136
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
3 $ hg init a |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
4 $ cd a |
7628
9c6ae2e09e11
diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff
changeset
|
5 |
12136
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
6 $ echo "first" > file.txt |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
7 $ hg add file.txt |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
8 $ hg commit -m 'first commit' # 0 |
7628
9c6ae2e09e11
diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff
changeset
|
9 |
12136
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
10 $ echo "second" > file.txt |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
11 $ hg commit -m 'second commit' # 1 |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
12 |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
13 $ echo "third" > file.txt |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
14 $ hg commit -m 'third commit' # 2 |
7628
9c6ae2e09e11
diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff
changeset
|
15 |
12136
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
16 $ hg diff --nodates --change 1 |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
17 diff -r 4bb65dda5db4 -r e9b286083166 file.txt |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
18 --- a/file.txt |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
19 +++ b/file.txt |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
20 @@ -1,1 +1,1 @@ |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
21 -first |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
22 +second |
7628
9c6ae2e09e11
diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff
changeset
|
23 |
12136
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
24 $ hg diff --change e9b286083166 |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
25 diff -r 4bb65dda5db4 -r e9b286083166 file.txt |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
26 --- a/file.txt Thu Jan 01 00:00:00 1970 +0000 |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
27 +++ b/file.txt Thu Jan 01 00:00:00 1970 +0000 |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
28 @@ -1,1 +1,1 @@ |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
29 -first |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
30 +second |
7628
9c6ae2e09e11
diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff
changeset
|
31 |
46087
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
32 Test --from and --to |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
33 |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
34 $ hg diff --from . --rev . |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
35 abort: cannot specify both --from and --rev |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
36 [10] |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
37 $ hg diff --to . --rev . |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
38 abort: cannot specify both --to and --rev |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
39 [10] |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
40 $ hg diff --from . --change . |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
41 abort: cannot specify both --from and --change |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
42 [10] |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
43 $ hg diff --to . --change . |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
44 abort: cannot specify both --to and --change |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
45 [10] |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
46 $ echo dirty > file.txt |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
47 $ hg diff --from . |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
48 diff -r bf5ff72eb7e0 file.txt |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
49 --- a/file.txt Thu Jan 01 00:00:00 1970 +0000 |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
50 +++ b/file.txt Thu Jan 01 00:00:00 1970 +0000 |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
51 @@ -1,1 +1,1 @@ |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
52 -third |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
53 +dirty |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
54 $ hg diff --from . --reverse |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
55 diff -r bf5ff72eb7e0 file.txt |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
56 --- a/file.txt Thu Jan 01 00:00:00 1970 +0000 |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
57 +++ b/file.txt Thu Jan 01 00:00:00 1970 +0000 |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
58 @@ -1,1 +1,1 @@ |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
59 -dirty |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
60 +third |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
61 $ hg diff --to . |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
62 diff -r bf5ff72eb7e0 file.txt |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
63 --- a/file.txt Thu Jan 01 00:00:00 1970 +0000 |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
64 +++ b/file.txt Thu Jan 01 00:00:00 1970 +0000 |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
65 @@ -1,1 +1,1 @@ |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
66 -dirty |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
67 +third |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
68 $ hg diff --from 0 --to 2 |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
69 diff -r 4bb65dda5db4 -r bf5ff72eb7e0 file.txt |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
70 --- a/file.txt Thu Jan 01 00:00:00 1970 +0000 |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
71 +++ b/file.txt Thu Jan 01 00:00:00 1970 +0000 |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
72 @@ -1,1 +1,1 @@ |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
73 -first |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
74 +third |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
75 $ hg diff --from 2 --to 0 |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
76 diff -r bf5ff72eb7e0 -r 4bb65dda5db4 file.txt |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
77 --- a/file.txt Thu Jan 01 00:00:00 1970 +0000 |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
78 +++ b/file.txt Thu Jan 01 00:00:00 1970 +0000 |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
79 @@ -1,1 +1,1 @@ |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
80 -third |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
81 +first |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
82 $ hg co -C . |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
83 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
64292addbe67
diff: add --from and --to flags as clearer alternative to -r -r
Martin von Zweigbergk <martinvonz@google.com>
parents:
29771
diff
changeset
|
84 |
26019
85f5352c7ca7
revpair: update test to make a difference if odd range not handled specially
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
85 $ cd .. |
85f5352c7ca7
revpair: update test to make a difference if odd range not handled specially
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
86 |
26020
cc3a30ff9490
revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents:
26019
diff
changeset
|
87 Test dumb revspecs: top-level "x:y", "x:", ":y" and ":" ranges should be handled |
cc3a30ff9490
revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents:
26019
diff
changeset
|
88 as pairs even if x == y, but not for "f(x:y)" nor "x::y" (issue3474, issue4774) |
16790
2a0efa1112ac
revpair: handle odd ranges (issue3474)
Matt Mackall <mpm@selenic.com>
parents:
16487
diff
changeset
|
89 |
26019
85f5352c7ca7
revpair: update test to make a difference if odd range not handled specially
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
90 $ hg clone -q a dumbspec |
85f5352c7ca7
revpair: update test to make a difference if odd range not handled specially
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
91 $ cd dumbspec |
85f5352c7ca7
revpair: update test to make a difference if odd range not handled specially
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
92 $ echo "wdir" > file.txt |
85f5352c7ca7
revpair: update test to make a difference if odd range not handled specially
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
93 |
16790
2a0efa1112ac
revpair: handle odd ranges (issue3474)
Matt Mackall <mpm@selenic.com>
parents:
16487
diff
changeset
|
94 $ hg diff -r 2:2 |
26020
cc3a30ff9490
revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents:
26019
diff
changeset
|
95 $ hg diff -r 2:. |
cc3a30ff9490
revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents:
26019
diff
changeset
|
96 $ hg diff -r 2: |
cc3a30ff9490
revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents:
26019
diff
changeset
|
97 $ hg diff -r :0 |
cc3a30ff9490
revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents:
26019
diff
changeset
|
98 $ hg diff -r '2:first(2:2)' |
cc3a30ff9490
revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents:
26019
diff
changeset
|
99 $ hg diff -r 'first(2:2)' --nodates |
cc3a30ff9490
revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents:
26019
diff
changeset
|
100 diff -r bf5ff72eb7e0 file.txt |
cc3a30ff9490
revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents:
26019
diff
changeset
|
101 --- a/file.txt |
cc3a30ff9490
revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents:
26019
diff
changeset
|
102 +++ b/file.txt |
cc3a30ff9490
revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents:
26019
diff
changeset
|
103 @@ -1,1 +1,1 @@ |
cc3a30ff9490
revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents:
26019
diff
changeset
|
104 -third |
cc3a30ff9490
revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents:
26019
diff
changeset
|
105 +wdir |
29771
98976e3cae57
revpair: do not optimize tree to check for odd-range spec
Yuya Nishihara <yuya@tcha.org>
parents:
26020
diff
changeset
|
106 $ hg diff -r '(2:2)' --nodates |
98976e3cae57
revpair: do not optimize tree to check for odd-range spec
Yuya Nishihara <yuya@tcha.org>
parents:
26020
diff
changeset
|
107 diff -r bf5ff72eb7e0 file.txt |
98976e3cae57
revpair: do not optimize tree to check for odd-range spec
Yuya Nishihara <yuya@tcha.org>
parents:
26020
diff
changeset
|
108 --- a/file.txt |
98976e3cae57
revpair: do not optimize tree to check for odd-range spec
Yuya Nishihara <yuya@tcha.org>
parents:
26020
diff
changeset
|
109 +++ b/file.txt |
98976e3cae57
revpair: do not optimize tree to check for odd-range spec
Yuya Nishihara <yuya@tcha.org>
parents:
26020
diff
changeset
|
110 @@ -1,1 +1,1 @@ |
98976e3cae57
revpair: do not optimize tree to check for odd-range spec
Yuya Nishihara <yuya@tcha.org>
parents:
26020
diff
changeset
|
111 -third |
98976e3cae57
revpair: do not optimize tree to check for odd-range spec
Yuya Nishihara <yuya@tcha.org>
parents:
26020
diff
changeset
|
112 +wdir |
26020
cc3a30ff9490
revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents:
26019
diff
changeset
|
113 $ hg diff -r 2::2 --nodates |
cc3a30ff9490
revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents:
26019
diff
changeset
|
114 diff -r bf5ff72eb7e0 file.txt |
cc3a30ff9490
revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents:
26019
diff
changeset
|
115 --- a/file.txt |
cc3a30ff9490
revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents:
26019
diff
changeset
|
116 +++ b/file.txt |
cc3a30ff9490
revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents:
26019
diff
changeset
|
117 @@ -1,1 +1,1 @@ |
cc3a30ff9490
revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents:
26019
diff
changeset
|
118 -third |
cc3a30ff9490
revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents:
26019
diff
changeset
|
119 +wdir |
16790
2a0efa1112ac
revpair: handle odd ranges (issue3474)
Matt Mackall <mpm@selenic.com>
parents:
16487
diff
changeset
|
120 $ hg diff -r "2 and 1" |
2a0efa1112ac
revpair: handle odd ranges (issue3474)
Matt Mackall <mpm@selenic.com>
parents:
16487
diff
changeset
|
121 abort: empty revision range |
2a0efa1112ac
revpair: handle odd ranges (issue3474)
Matt Mackall <mpm@selenic.com>
parents:
16487
diff
changeset
|
122 [255] |
7628
9c6ae2e09e11
diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff
changeset
|
123 |
26019
85f5352c7ca7
revpair: update test to make a difference if odd range not handled specially
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
124 $ cd .. |
85f5352c7ca7
revpair: update test to make a difference if odd range not handled specially
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
125 |
26020
cc3a30ff9490
revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents:
26019
diff
changeset
|
126 $ hg clone -qr0 a dumbspec-rev0 |
cc3a30ff9490
revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents:
26019
diff
changeset
|
127 $ cd dumbspec-rev0 |
cc3a30ff9490
revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents:
26019
diff
changeset
|
128 $ echo "wdir" > file.txt |
cc3a30ff9490
revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents:
26019
diff
changeset
|
129 |
cc3a30ff9490
revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents:
26019
diff
changeset
|
130 $ hg diff -r : |
cc3a30ff9490
revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents:
26019
diff
changeset
|
131 $ hg diff -r 'first(:)' --nodates |
cc3a30ff9490
revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents:
26019
diff
changeset
|
132 diff -r 4bb65dda5db4 file.txt |
cc3a30ff9490
revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents:
26019
diff
changeset
|
133 --- a/file.txt |
cc3a30ff9490
revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents:
26019
diff
changeset
|
134 +++ b/file.txt |
cc3a30ff9490
revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents:
26019
diff
changeset
|
135 @@ -1,1 +1,1 @@ |
cc3a30ff9490
revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents:
26019
diff
changeset
|
136 -first |
cc3a30ff9490
revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents:
26019
diff
changeset
|
137 +wdir |
cc3a30ff9490
revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents:
26019
diff
changeset
|
138 |
cc3a30ff9490
revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents:
26019
diff
changeset
|
139 $ cd .. |
cc3a30ff9490
revpair: restrict odd-range handling to top-level x:y expression (issue4774)
Yuya Nishihara <yuya@tcha.org>
parents:
26019
diff
changeset
|
140 |
12136
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
141 Testing diff --change when merge: |
7628
9c6ae2e09e11
diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff
changeset
|
142 |
26019
85f5352c7ca7
revpair: update test to make a difference if odd range not handled specially
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
143 $ cd a |
85f5352c7ca7
revpair: update test to make a difference if odd range not handled specially
Yuya Nishihara <yuya@tcha.org>
parents:
16913
diff
changeset
|
144 |
12136
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
145 $ for i in 1 2 3 4 5 6 7 8 9 10; do |
16487
4fe874697a4d
tests: fix incorrect markup of continued lines of sh commands
Mads Kiilerich <mads@kiilerich.com>
parents:
12136
diff
changeset
|
146 > echo $i >> file.txt |
4fe874697a4d
tests: fix incorrect markup of continued lines of sh commands
Mads Kiilerich <mads@kiilerich.com>
parents:
12136
diff
changeset
|
147 > done |
12136
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
148 $ hg commit -m "lots of text" # 3 |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
149 |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
150 $ sed -e 's,^2$,x,' file.txt > file.txt.tmp |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
151 $ mv file.txt.tmp file.txt |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
152 $ hg commit -m "change 2 to x" # 4 |
7628
9c6ae2e09e11
diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff
changeset
|
153 |
12136
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
154 $ hg up -r 3 |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
155 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
156 $ sed -e 's,^8$,y,' file.txt > file.txt.tmp |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
157 $ mv file.txt.tmp file.txt |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
158 $ hg commit -m "change 8 to y" |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
159 created new head |
7628
9c6ae2e09e11
diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff
changeset
|
160 |
12136
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
161 $ hg up -C -r 4 |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
162 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
163 $ hg merge -r 5 |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
164 merging file.txt |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
165 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
166 (branch merge, don't forget to commit) |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
167 $ hg commit -m "merge 8 to y" # 6 |
7628
9c6ae2e09e11
diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff
changeset
|
168 |
12136
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
169 $ hg diff --change 5 |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
170 diff -r ae119d680c82 -r 9085c5c02e52 file.txt |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
171 --- a/file.txt Thu Jan 01 00:00:00 1970 +0000 |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
172 +++ b/file.txt Thu Jan 01 00:00:00 1970 +0000 |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
173 @@ -6,6 +6,6 @@ |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
174 5 |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
175 6 |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
176 7 |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
177 -8 |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
178 +y |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
179 9 |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
180 10 |
7628
9c6ae2e09e11
diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff
changeset
|
181 |
12136
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
182 must be similar to 'hg diff --change 5': |
7628
9c6ae2e09e11
diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff
changeset
|
183 |
12136
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
184 $ hg diff -c 6 |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
185 diff -r 273b50f17c6d -r 979ca961fd2e file.txt |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
186 --- a/file.txt Thu Jan 01 00:00:00 1970 +0000 |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
187 +++ b/file.txt Thu Jan 01 00:00:00 1970 +0000 |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
188 @@ -6,6 +6,6 @@ |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
189 5 |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
190 6 |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
191 7 |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
192 -8 |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
193 +y |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
194 9 |
30b5e83004e0
tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents:
7680
diff
changeset
|
195 10 |
7628
9c6ae2e09e11
diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff
changeset
|
196 |
46448
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
197 merge diff should show only manual edits to a merge: |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
198 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
199 $ hg diff --merge -c 6 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
200 merging file.txt |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
201 (no diff output is expected here) |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
202 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
203 Construct an "evil merge" that does something other than just the merge. |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
204 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
205 $ hg co ".^" |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
206 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
207 $ hg merge -r 5 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
208 merging file.txt |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
209 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
210 (branch merge, don't forget to commit) |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
211 $ echo 11 >> file.txt |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
212 $ hg ci -m 'merge 8 to y with manual edit of 11' # 7 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
213 created new head |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
214 $ hg diff -c 7 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
215 diff -r 273b50f17c6d -r 8ad85e839ba7 file.txt |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
216 --- a/file.txt Thu Jan 01 00:00:00 1970 +0000 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
217 +++ b/file.txt Thu Jan 01 00:00:00 1970 +0000 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
218 @@ -6,6 +6,7 @@ |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
219 5 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
220 6 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
221 7 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
222 -8 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
223 +y |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
224 9 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
225 10 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
226 +11 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
227 Contrast with the `hg diff -c 7` version above: only the manual edit shows |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
228 up, making it easy to identify changes someone is otherwise trying to sneak |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
229 into a merge. |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
230 $ hg diff --merge -c 7 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
231 merging file.txt |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
232 diff -r 8ad85e839ba7 file.txt |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
233 --- a/file.txt Thu Jan 01 00:00:00 1970 +0000 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
234 +++ b/file.txt Thu Jan 01 00:00:00 1970 +0000 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
235 @@ -9,3 +9,4 @@ |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
236 y |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
237 9 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
238 10 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
239 +11 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
240 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
241 Set up a conflict. |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
242 $ hg co ".^" |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
243 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
244 $ sed -e 's,^8$,z,' file.txt > file.txt.tmp |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
245 $ mv file.txt.tmp file.txt |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
246 $ hg ci -m 'conflicting edit: 8 to z' |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
247 created new head |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
248 $ echo "this file is new in p1 of the merge" > new-file-p1.txt |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
249 $ hg ci -Am 'new file' new-file-p1.txt |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
250 $ hg log -r . --template 'p1 will be rev {rev}\n' |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
251 p1 will be rev 9 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
252 $ hg co 5 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
253 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
254 $ echo "this file is new in p2 of the merge" > new-file-p2.txt |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
255 $ hg ci -Am 'new file' new-file-p2.txt |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
256 created new head |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
257 $ hg log -r . --template 'p2 will be rev {rev}\n' |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
258 p2 will be rev 10 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
259 $ hg co -- 9 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
260 2 files updated, 0 files merged, 1 files removed, 0 files unresolved |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
261 $ hg merge -r 10 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
262 merging file.txt |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
263 warning: conflicts while merging file.txt! (edit, then use 'hg resolve --mark') |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
264 1 files updated, 0 files merged, 0 files removed, 1 files unresolved |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
265 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
266 [1] |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
267 $ hg revert file.txt -r . |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
268 $ hg resolve -ma |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
269 (no more unresolved files) |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
270 $ hg commit -m 'merge conflicted edit' |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
271 Without --merge, it's a diff against p1 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
272 $ hg diff --no-merge -c 11 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
273 diff -r fd1f17c90d7c -r 5010caab09f6 new-file-p2.txt |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
274 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
275 +++ b/new-file-p2.txt Thu Jan 01 00:00:00 1970 +0000 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
276 @@ -0,0 +1,1 @@ |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
277 +this file is new in p2 of the merge |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
278 With --merge, it's a diff against the conflicted content. |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
279 $ hg diff --merge -c 11 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
280 merging file.txt |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
281 diff -r 5010caab09f6 file.txt |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
282 --- a/file.txt Thu Jan 01 00:00:00 1970 +0000 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
283 +++ b/file.txt Thu Jan 01 00:00:00 1970 +0000 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
284 @@ -6,12 +6,6 @@ |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
285 5 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
286 6 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
287 7 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
288 -<<<<<<< local: fd1f17c90d7c - test: new file |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
289 z |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
290 -||||||| base |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
291 -8 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
292 -======= |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
293 -y |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
294 ->>>>>>> other: d9e7de69eac3 - test: new file |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
295 9 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
296 10 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
297 |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
298 There must _NOT_ be a .hg/merge directory leftover. |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
299 $ test ! -d .hg/merge |
1a7d12c82057
diff: add experimental support for "merge diffs"
Augie Fackler <augie@google.com>
parents:
46087
diff
changeset
|
300 (No output is expected) |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
16790
diff
changeset
|
301 $ cd .. |