##// END OF EJS Templates
py3: use '//' for integer divisions...
Pulkit Goyal -
r36408:34afe92e default
parent child Browse files
Show More
@@ -1,197 +1,197 b''
1
1
2 Issue835: qpush fails immediately when patching a missing file, but
2 Issue835: qpush fails immediately when patching a missing file, but
3 remaining added files are still created empty which will trick a
3 remaining added files are still created empty which will trick a
4 future qrefresh.
4 future qrefresh.
5
5
6 $ cat > writelines.py <<EOF
6 $ cat > writelines.py <<EOF
7 > import sys
7 > import sys
8 > path = sys.argv[1]
8 > path = sys.argv[1]
9 > args = sys.argv[2:]
9 > args = sys.argv[2:]
10 > assert (len(args) % 2) == 0
10 > assert (len(args) % 2) == 0
11 >
11 >
12 > f = open(path, 'wb')
12 > f = open(path, 'wb')
13 > for i in range(len(args)/2):
13 > for i in range(len(args) // 2):
14 > count, s = args[2*i:2*i+2]
14 > count, s = args[2*i:2*i+2]
15 > count = int(count)
15 > count = int(count)
16 > s = s.decode('string_escape')
16 > s = s.decode('string_escape')
17 > f.write(s*count)
17 > f.write(s*count)
18 > f.close()
18 > f.close()
19 > EOF
19 > EOF
20
20
21 $ echo "[extensions]" >> $HGRCPATH
21 $ echo "[extensions]" >> $HGRCPATH
22 $ echo "mq=" >> $HGRCPATH
22 $ echo "mq=" >> $HGRCPATH
23
23
24 $ hg init normal
24 $ hg init normal
25 $ cd normal
25 $ cd normal
26 $ $PYTHON ../writelines.py b 10 'a\n'
26 $ $PYTHON ../writelines.py b 10 'a\n'
27 $ hg ci -Am addb
27 $ hg ci -Am addb
28 adding b
28 adding b
29 $ echo a > a
29 $ echo a > a
30 $ $PYTHON ../writelines.py b 2 'b\n' 10 'a\n' 2 'c\n'
30 $ $PYTHON ../writelines.py b 2 'b\n' 10 'a\n' 2 'c\n'
31 $ echo c > c
31 $ echo c > c
32 $ hg add a c
32 $ hg add a c
33 $ hg qnew -f changeb
33 $ hg qnew -f changeb
34 $ hg qpop
34 $ hg qpop
35 popping changeb
35 popping changeb
36 patch queue now empty
36 patch queue now empty
37 $ hg rm b
37 $ hg rm b
38 $ hg ci -Am rmb
38 $ hg ci -Am rmb
39
39
40 Push patch with missing target:
40 Push patch with missing target:
41
41
42 $ hg qpush
42 $ hg qpush
43 applying changeb
43 applying changeb
44 unable to find 'b' for patching
44 unable to find 'b' for patching
45 (use '--prefix' to apply patch relative to the current directory)
45 (use '--prefix' to apply patch relative to the current directory)
46 2 out of 2 hunks FAILED -- saving rejects to file b.rej
46 2 out of 2 hunks FAILED -- saving rejects to file b.rej
47 patch failed, unable to continue (try -v)
47 patch failed, unable to continue (try -v)
48 patch failed, rejects left in working directory
48 patch failed, rejects left in working directory
49 errors during apply, please fix and qrefresh changeb
49 errors during apply, please fix and qrefresh changeb
50 [2]
50 [2]
51
51
52 Display added files:
52 Display added files:
53
53
54 $ cat a
54 $ cat a
55 a
55 a
56 $ cat c
56 $ cat c
57 c
57 c
58
58
59 Display rejections:
59 Display rejections:
60
60
61 $ cat b.rej
61 $ cat b.rej
62 --- b
62 --- b
63 +++ b
63 +++ b
64 @@ -1,3 +1,5 @@
64 @@ -1,3 +1,5 @@
65 +b
65 +b
66 +b
66 +b
67 a
67 a
68 a
68 a
69 a
69 a
70 @@ -8,3 +10,5 @@
70 @@ -8,3 +10,5 @@
71 a
71 a
72 a
72 a
73 a
73 a
74 +c
74 +c
75 +c
75 +c
76
76
77 Test missing renamed file
77 Test missing renamed file
78
78
79 $ hg qpop
79 $ hg qpop
80 popping changeb
80 popping changeb
81 patch queue now empty
81 patch queue now empty
82 $ hg up -qC 0
82 $ hg up -qC 0
83 $ echo a > a
83 $ echo a > a
84 $ hg mv b bb
84 $ hg mv b bb
85 $ $PYTHON ../writelines.py bb 2 'b\n' 10 'a\n' 2 'c\n'
85 $ $PYTHON ../writelines.py bb 2 'b\n' 10 'a\n' 2 'c\n'
86 $ echo c > c
86 $ echo c > c
87 $ hg add a c
87 $ hg add a c
88 $ hg qnew changebb
88 $ hg qnew changebb
89 $ hg qpop
89 $ hg qpop
90 popping changebb
90 popping changebb
91 patch queue now empty
91 patch queue now empty
92 $ hg up -qC 1
92 $ hg up -qC 1
93 $ hg qpush
93 $ hg qpush
94 applying changebb
94 applying changebb
95 patching file bb
95 patching file bb
96 Hunk #1 FAILED at 0
96 Hunk #1 FAILED at 0
97 Hunk #2 FAILED at 7
97 Hunk #2 FAILED at 7
98 2 out of 2 hunks FAILED -- saving rejects to file bb.rej
98 2 out of 2 hunks FAILED -- saving rejects to file bb.rej
99 b not tracked!
99 b not tracked!
100 patch failed, unable to continue (try -v)
100 patch failed, unable to continue (try -v)
101 patch failed, rejects left in working directory
101 patch failed, rejects left in working directory
102 errors during apply, please fix and qrefresh changebb
102 errors during apply, please fix and qrefresh changebb
103 [2]
103 [2]
104 $ cat a
104 $ cat a
105 a
105 a
106 $ cat c
106 $ cat c
107 c
107 c
108 $ cat bb.rej
108 $ cat bb.rej
109 --- bb
109 --- bb
110 +++ bb
110 +++ bb
111 @@ -1,3 +1,5 @@
111 @@ -1,3 +1,5 @@
112 +b
112 +b
113 +b
113 +b
114 a
114 a
115 a
115 a
116 a
116 a
117 @@ -8,3 +10,5 @@
117 @@ -8,3 +10,5 @@
118 a
118 a
119 a
119 a
120 a
120 a
121 +c
121 +c
122 +c
122 +c
123
123
124 $ cd ..
124 $ cd ..
125
125
126
126
127 $ echo "[diff]" >> $HGRCPATH
127 $ echo "[diff]" >> $HGRCPATH
128 $ echo "git=1" >> $HGRCPATH
128 $ echo "git=1" >> $HGRCPATH
129
129
130 $ hg init git
130 $ hg init git
131 $ cd git
131 $ cd git
132 $ $PYTHON ../writelines.py b 1 '\x00'
132 $ $PYTHON ../writelines.py b 1 '\x00'
133 $ hg ci -Am addb
133 $ hg ci -Am addb
134 adding b
134 adding b
135 $ echo a > a
135 $ echo a > a
136 $ $PYTHON ../writelines.py b 1 '\x01' 1 '\x00'
136 $ $PYTHON ../writelines.py b 1 '\x01' 1 '\x00'
137 $ echo c > c
137 $ echo c > c
138 $ hg add a c
138 $ hg add a c
139 $ hg qnew -f changeb
139 $ hg qnew -f changeb
140 $ hg qpop
140 $ hg qpop
141 popping changeb
141 popping changeb
142 patch queue now empty
142 patch queue now empty
143 $ hg rm b
143 $ hg rm b
144 $ hg ci -Am rmb
144 $ hg ci -Am rmb
145
145
146 Push git patch with missing target:
146 Push git patch with missing target:
147
147
148 $ hg qpush
148 $ hg qpush
149 applying changeb
149 applying changeb
150 unable to find 'b' for patching
150 unable to find 'b' for patching
151 (use '--prefix' to apply patch relative to the current directory)
151 (use '--prefix' to apply patch relative to the current directory)
152 1 out of 1 hunks FAILED -- saving rejects to file b.rej
152 1 out of 1 hunks FAILED -- saving rejects to file b.rej
153 patch failed, unable to continue (try -v)
153 patch failed, unable to continue (try -v)
154 patch failed, rejects left in working directory
154 patch failed, rejects left in working directory
155 errors during apply, please fix and qrefresh changeb
155 errors during apply, please fix and qrefresh changeb
156 [2]
156 [2]
157 $ hg st
157 $ hg st
158 ? b.rej
158 ? b.rej
159
159
160 Display added files:
160 Display added files:
161
161
162 $ cat a
162 $ cat a
163 a
163 a
164 $ cat c
164 $ cat c
165 c
165 c
166
166
167 Display rejections:
167 Display rejections:
168
168
169 $ cat b.rej
169 $ cat b.rej
170 --- b
170 --- b
171 +++ b
171 +++ b
172 GIT binary patch
172 GIT binary patch
173 literal 2
173 literal 2
174 Jc${No0000400IC2
174 Jc${No0000400IC2
175
175
176 $ cd ..
176 $ cd ..
177
177
178 Test push creating directory during git copy or rename:
178 Test push creating directory during git copy or rename:
179
179
180 $ hg init missingdir
180 $ hg init missingdir
181 $ cd missingdir
181 $ cd missingdir
182 $ echo a > a
182 $ echo a > a
183 $ hg ci -Am adda
183 $ hg ci -Am adda
184 adding a
184 adding a
185 $ mkdir d
185 $ mkdir d
186 $ hg copy a d/a2
186 $ hg copy a d/a2
187 $ hg mv a d/a
187 $ hg mv a d/a
188 $ hg qnew -g -f patch
188 $ hg qnew -g -f patch
189 $ hg qpop
189 $ hg qpop
190 popping patch
190 popping patch
191 patch queue now empty
191 patch queue now empty
192 $ hg qpush
192 $ hg qpush
193 applying patch
193 applying patch
194 now at: patch
194 now at: patch
195
195
196 $ cd ..
196 $ cd ..
197
197
General Comments 0
You need to be logged in to leave comments. Login now