##// END OF EJS Templates
fix issue 1763: strip chars from end of line when parsing gitpatch lines
Bill Barry -
r9243:df21a009 default
parent child Browse files
Show More
@@ -182,6 +182,7 b' def readgitpatch(lr):'
182 182 lineno = 0
183 183 for line in lr:
184 184 lineno += 1
185 line = line.rstrip(' \r\n')
185 186 if line.startswith('diff --git'):
186 187 m = gitre.match(line)
187 188 if m:
@@ -200,23 +201,23 b' def readgitpatch(lr):'
200 201 continue
201 202 if line.startswith('rename from '):
202 203 gp.op = 'RENAME'
203 gp.oldpath = line[12:].rstrip()
204 gp.oldpath = line[12:]
204 205 elif line.startswith('rename to '):
205 gp.path = line[10:].rstrip()
206 gp.path = line[10:]
206 207 elif line.startswith('copy from '):
207 208 gp.op = 'COPY'
208 gp.oldpath = line[10:].rstrip()
209 gp.oldpath = line[10:]
209 210 elif line.startswith('copy to '):
210 gp.path = line[8:].rstrip()
211 gp.path = line[8:]
211 212 elif line.startswith('deleted file'):
212 213 gp.op = 'DELETE'
213 214 # is the deleted file a symlink?
214 gp.setmode(int(line.rstrip()[-6:], 8))
215 gp.setmode(int(line[-6:], 8))
215 216 elif line.startswith('new file mode '):
216 217 gp.op = 'ADD'
217 gp.setmode(int(line.rstrip()[-6:], 8))
218 gp.setmode(int(line[-6:], 8))
218 219 elif line.startswith('new mode '):
219 gp.setmode(int(line.rstrip()[-6:], 8))
220 gp.setmode(int(line[-6:], 8))
220 221 elif line.startswith('GIT binary patch'):
221 222 dopatch |= GP_BINARY
222 223 gp.binary = True
General Comments 0
You need to be logged in to leave comments. Login now