Mercurial > hg
annotate tests/test-diff-unified.t @ 22376:d821fff9b0b9 stable
dispatch: make "_checkshellalias" reusable regardless of adding aliases
To reduce changes in the subsequent patch fixing issue4355, this patch
makes "_checkshellalias" reusable regardless of adding aliases.
In this patch, alias definitions are added and restored, only when
"precheck=True".
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Wed, 10 Sep 2014 00:41:44 +0900 |
parents | 6ef3107c661e |
children | d7abae94a7a0 |
rev | line source |
---|---|
12141
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
1 $ hg init repo |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
2 $ cd repo |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
3 $ cat > a <<EOF |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
4 > c |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
5 > c |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
6 > a |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
7 > a |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
8 > b |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
9 > a |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
10 > a |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
11 > c |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
12 > c |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
13 > EOF |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
14 $ hg ci -Am adda |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
15 adding a |
6467
65029a3aafc2
Let --unified default to diff.unified (issue 1076)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
16 |
12141
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
17 $ cat > a <<EOF |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
18 > c |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
19 > c |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
20 > a |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
21 > a |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
22 > dd |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
23 > a |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
24 > a |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
25 > c |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
26 > c |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
27 > EOF |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
28 |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
29 default context |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
30 |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
31 $ hg diff --nodates |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
32 diff -r cf9f4ba66af2 a |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
33 --- a/a |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
34 +++ b/a |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
35 @@ -2,7 +2,7 @@ |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
36 c |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
37 a |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
38 a |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
39 -b |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
40 +dd |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
41 a |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
42 a |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
43 c |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
44 |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
45 invalid --unified |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
46 |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
47 $ hg diff --nodates -U foo |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
48 abort: diff context lines count must be an integer, not 'foo' |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12141
diff
changeset
|
49 [255] |
12141
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
50 |
6467
65029a3aafc2
Let --unified default to diff.unified (issue 1076)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
51 |
12141
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
52 $ hg diff --nodates -U 2 |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
53 diff -r cf9f4ba66af2 a |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
54 --- a/a |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
55 +++ b/a |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
56 @@ -3,5 +3,5 @@ |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
57 a |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
58 a |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
59 -b |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
60 +dd |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
61 a |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
62 a |
6467
65029a3aafc2
Let --unified default to diff.unified (issue 1076)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
63 |
12141
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
64 $ hg --config diff.unified=2 diff --nodates |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
65 diff -r cf9f4ba66af2 a |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
66 --- a/a |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
67 +++ b/a |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
68 @@ -3,5 +3,5 @@ |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
69 a |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
70 a |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
71 -b |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
72 +dd |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
73 a |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
74 a |
6467
65029a3aafc2
Let --unified default to diff.unified (issue 1076)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
75 |
12141
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
76 $ hg diff --nodates -U 1 |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
77 diff -r cf9f4ba66af2 a |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
78 --- a/a |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
79 +++ b/a |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
80 @@ -4,3 +4,3 @@ |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
81 a |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
82 -b |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
83 +dd |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
84 a |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
85 |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
86 invalid diff.unified |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
87 |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
88 $ hg --config diff.unified=foo diff --nodates |
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
89 abort: diff context lines count must be an integer, not 'foo' |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12141
diff
changeset
|
90 [255] |
12141
5f44daa8fbd0
tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents:
7440
diff
changeset
|
91 |
16912
6ef3107c661e
tests: cleanup of tests that got lost in their own nested directories
Mads Kiilerich <mads@kiilerich.com>
parents:
16362
diff
changeset
|
92 $ cd .. |
6ef3107c661e
tests: cleanup of tests that got lost in their own nested directories
Mads Kiilerich <mads@kiilerich.com>
parents:
16362
diff
changeset
|
93 |
6ef3107c661e
tests: cleanup of tests that got lost in their own nested directories
Mads Kiilerich <mads@kiilerich.com>
parents:
16362
diff
changeset
|
94 |
15462
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
95 0 lines of context hunk header matches gnu diff hunk header |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
96 |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
97 $ hg init diffzero |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
98 $ cd diffzero |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
99 $ cat > f1 << EOF |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
100 > c2 |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
101 > c4 |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
102 > c5 |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
103 > EOF |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
104 $ hg commit -Am0 |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
105 adding f1 |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
106 |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
107 $ cat > f2 << EOF |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
108 > c1 |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
109 > c2 |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
110 > c3 |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
111 > c4 |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
112 > EOF |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
113 $ mv f2 f1 |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
114 $ hg diff -U0 --nodates |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
115 diff -r 55d8ff78db23 f1 |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
116 --- a/f1 |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
117 +++ b/f1 |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
118 @@ -0,0 +1,1 @@ |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
119 +c1 |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
120 @@ -1,0 +3,1 @@ |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
121 +c3 |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
122 @@ -3,1 +4,0 @@ |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
123 -c5 |
6467
65029a3aafc2
Let --unified default to diff.unified (issue 1076)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
124 |
15462
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
125 $ hg diff -U0 --nodates --git |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
126 diff --git a/f1 b/f1 |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
127 --- a/f1 |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
128 +++ b/f1 |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
129 @@ -0,0 +1,1 @@ |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
130 +c1 |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
131 @@ -1,0 +3,1 @@ |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
132 +c3 |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
133 @@ -3,1 +4,0 @@ |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
134 -c5 |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
135 |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
136 $ hg diff -U0 --nodates -p |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
137 diff -r 55d8ff78db23 f1 |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
138 --- a/f1 |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
139 +++ b/f1 |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
140 @@ -0,0 +1,1 @@ |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
141 +c1 |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
142 @@ -1,0 +3,1 @@ c2 |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
143 +c3 |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
144 @@ -3,1 +4,0 @@ c4 |
2b1ec74c961f
mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents:
12316
diff
changeset
|
145 -c5 |
16362
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
146 |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
147 $ echo a > f1 |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
148 $ hg ci -m movef2 |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
149 |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
150 Test diff headers terminating with TAB when necessary (issue3357) |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
151 Regular diff --nodates, file creation |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
152 |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
153 $ hg mv f1 'f 1' |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
154 $ echo b > 'f 1' |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
155 $ hg diff --nodates 'f 1' |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
156 diff -r 7574207d0d15 f 1 |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
157 --- /dev/null |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
158 +++ b/f 1 |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
159 @@ -0,0 +1,1 @@ |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
160 +b |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
161 |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
162 Git diff, adding space |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
163 |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
164 $ hg diff --git |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
165 diff --git a/f1 b/f 1 |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
166 rename from f1 |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
167 rename to f 1 |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
168 --- a/f1 |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
169 +++ b/f 1 |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
170 @@ -1,1 +1,1 @@ |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
171 -a |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
172 +b |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
173 |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
174 Regular diff --nodates, file deletion |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
175 |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
176 $ hg ci -m addspace |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
177 $ hg mv 'f 1' f1 |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
178 $ echo a > f1 |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
179 $ hg diff --nodates 'f 1' |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
180 diff -r ca50fe67c9c7 f 1 |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
181 --- a/f 1 |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
182 +++ /dev/null |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
183 @@ -1,1 +0,0 @@ |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
184 -b |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
185 |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
186 Git diff, removing space |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
187 |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
188 $ hg diff --git |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
189 diff --git a/f 1 b/f1 |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
190 rename from f 1 |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
191 rename to f1 |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
192 --- a/f 1 |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
193 +++ b/f1 |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
194 @@ -1,1 +1,1 @@ |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
195 -b |
16b75661828e
mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents:
16012
diff
changeset
|
196 +a |
16912
6ef3107c661e
tests: cleanup of tests that got lost in their own nested directories
Mads Kiilerich <mads@kiilerich.com>
parents:
16362
diff
changeset
|
197 |
6ef3107c661e
tests: cleanup of tests that got lost in their own nested directories
Mads Kiilerich <mads@kiilerich.com>
parents:
16362
diff
changeset
|
198 $ cd .. |