##// END OF EJS Templates
revpair: update test to make a difference if odd range not handled specially...
Yuya Nishihara -
r26019:85f5352c default
parent child Browse files
Show More
@@ -1,93 +1,103 b''
1 Testing diff --change
1 Testing diff --change
2
2
3 $ hg init a
3 $ hg init a
4 $ cd a
4 $ cd a
5
5
6 $ echo "first" > file.txt
6 $ echo "first" > file.txt
7 $ hg add file.txt
7 $ hg add file.txt
8 $ hg commit -m 'first commit' # 0
8 $ hg commit -m 'first commit' # 0
9
9
10 $ echo "second" > file.txt
10 $ echo "second" > file.txt
11 $ hg commit -m 'second commit' # 1
11 $ hg commit -m 'second commit' # 1
12
12
13 $ echo "third" > file.txt
13 $ echo "third" > file.txt
14 $ hg commit -m 'third commit' # 2
14 $ hg commit -m 'third commit' # 2
15
15
16 $ hg diff --nodates --change 1
16 $ hg diff --nodates --change 1
17 diff -r 4bb65dda5db4 -r e9b286083166 file.txt
17 diff -r 4bb65dda5db4 -r e9b286083166 file.txt
18 --- a/file.txt
18 --- a/file.txt
19 +++ b/file.txt
19 +++ b/file.txt
20 @@ -1,1 +1,1 @@
20 @@ -1,1 +1,1 @@
21 -first
21 -first
22 +second
22 +second
23
23
24 $ hg diff --change e9b286083166
24 $ hg diff --change e9b286083166
25 diff -r 4bb65dda5db4 -r e9b286083166 file.txt
25 diff -r 4bb65dda5db4 -r e9b286083166 file.txt
26 --- a/file.txt Thu Jan 01 00:00:00 1970 +0000
26 --- a/file.txt Thu Jan 01 00:00:00 1970 +0000
27 +++ b/file.txt Thu Jan 01 00:00:00 1970 +0000
27 +++ b/file.txt Thu Jan 01 00:00:00 1970 +0000
28 @@ -1,1 +1,1 @@
28 @@ -1,1 +1,1 @@
29 -first
29 -first
30 +second
30 +second
31
31
32 $ cd ..
33
32 Test dumb revspecs (issue3474)
34 Test dumb revspecs (issue3474)
33
35
36 $ hg clone -q a dumbspec
37 $ cd dumbspec
38 $ echo "wdir" > file.txt
39
34 $ hg diff -r 2:2
40 $ hg diff -r 2:2
35 $ hg diff -r "2 and 1"
41 $ hg diff -r "2 and 1"
36 abort: empty revision range
42 abort: empty revision range
37 [255]
43 [255]
38
44
45 $ cd ..
46
39 Testing diff --change when merge:
47 Testing diff --change when merge:
40
48
49 $ cd a
50
41 $ for i in 1 2 3 4 5 6 7 8 9 10; do
51 $ for i in 1 2 3 4 5 6 7 8 9 10; do
42 > echo $i >> file.txt
52 > echo $i >> file.txt
43 > done
53 > done
44 $ hg commit -m "lots of text" # 3
54 $ hg commit -m "lots of text" # 3
45
55
46 $ sed -e 's,^2$,x,' file.txt > file.txt.tmp
56 $ sed -e 's,^2$,x,' file.txt > file.txt.tmp
47 $ mv file.txt.tmp file.txt
57 $ mv file.txt.tmp file.txt
48 $ hg commit -m "change 2 to x" # 4
58 $ hg commit -m "change 2 to x" # 4
49
59
50 $ hg up -r 3
60 $ hg up -r 3
51 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
61 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
52 $ sed -e 's,^8$,y,' file.txt > file.txt.tmp
62 $ sed -e 's,^8$,y,' file.txt > file.txt.tmp
53 $ mv file.txt.tmp file.txt
63 $ mv file.txt.tmp file.txt
54 $ hg commit -m "change 8 to y"
64 $ hg commit -m "change 8 to y"
55 created new head
65 created new head
56
66
57 $ hg up -C -r 4
67 $ hg up -C -r 4
58 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
68 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
59 $ hg merge -r 5
69 $ hg merge -r 5
60 merging file.txt
70 merging file.txt
61 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
71 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
62 (branch merge, don't forget to commit)
72 (branch merge, don't forget to commit)
63 $ hg commit -m "merge 8 to y" # 6
73 $ hg commit -m "merge 8 to y" # 6
64
74
65 $ hg diff --change 5
75 $ hg diff --change 5
66 diff -r ae119d680c82 -r 9085c5c02e52 file.txt
76 diff -r ae119d680c82 -r 9085c5c02e52 file.txt
67 --- a/file.txt Thu Jan 01 00:00:00 1970 +0000
77 --- a/file.txt Thu Jan 01 00:00:00 1970 +0000
68 +++ b/file.txt Thu Jan 01 00:00:00 1970 +0000
78 +++ b/file.txt Thu Jan 01 00:00:00 1970 +0000
69 @@ -6,6 +6,6 @@
79 @@ -6,6 +6,6 @@
70 5
80 5
71 6
81 6
72 7
82 7
73 -8
83 -8
74 +y
84 +y
75 9
85 9
76 10
86 10
77
87
78 must be similar to 'hg diff --change 5':
88 must be similar to 'hg diff --change 5':
79
89
80 $ hg diff -c 6
90 $ hg diff -c 6
81 diff -r 273b50f17c6d -r 979ca961fd2e file.txt
91 diff -r 273b50f17c6d -r 979ca961fd2e file.txt
82 --- a/file.txt Thu Jan 01 00:00:00 1970 +0000
92 --- a/file.txt Thu Jan 01 00:00:00 1970 +0000
83 +++ b/file.txt Thu Jan 01 00:00:00 1970 +0000
93 +++ b/file.txt Thu Jan 01 00:00:00 1970 +0000
84 @@ -6,6 +6,6 @@
94 @@ -6,6 +6,6 @@
85 5
95 5
86 6
96 6
87 7
97 7
88 -8
98 -8
89 +y
99 +y
90 9
100 9
91 10
101 10
92
102
93 $ cd ..
103 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now