comparison hgext/convert/gnuarch.py @ 6055:a3d8b1f8721d

convert: support binary files, link to files (viceversa) in gnu arch
author Aleix Conchillo Flaque <aleix@member.fsf.org>
date Sat, 09 Feb 2008 17:36:42 +0100
parents 348132c112cf
children ebc23d34102f
comparison
equal deleted inserted replaced
6054:e2cbdd931341 6055:a3d8b1f8721d
244 self.changes[rev].summary = '\n'.join(summary) 244 self.changes[rev].summary = '\n'.join(summary)
245 245
246 def _parsechangeset(self, data, rev): 246 def _parsechangeset(self, data, rev):
247 for l in data: 247 for l in data:
248 l = l.strip() 248 l = l.strip()
249 # Added file (ignore added directory)
249 if l.startswith('A') and not l.startswith('A/'): 250 if l.startswith('A') and not l.startswith('A/'):
250 file = l[1:].strip() 251 file = l[1:].strip()
251 if not self._exclude(file): 252 if not self._exclude(file):
252 self.changes[rev].add_files.append(file) 253 self.changes[rev].add_files.append(file)
254 # Deleted file (ignore deleted directory)
255 elif l.startswith('D') and not l.startswith('D/'):
256 file = l[1:].strip()
257 if not self._exclude(file):
258 self.changes[rev].del_files.append(file)
259 # Modified binary file
260 elif l.startswith('Mb'):
261 file = l[2:].strip()
262 if not self._exclude(file):
263 self.changes[rev].mod_files.append(file)
264 # Modified link
265 elif l.startswith('M->'):
266 file = l[3:].strip()
267 if not self._exclude(file):
268 self.changes[rev].mod_files.append(file)
269 # Modified file
270 elif l.startswith('M'):
271 file = l[1:].strip()
272 if not self._exclude(file):
273 self.changes[rev].mod_files.append(file)
274 # Renamed file (or link)
275 elif l.startswith('=>'):
276 files = l[2:].strip().split(' ')
277 if len(files) == 1:
278 files = l[2:].strip().split('\t')
279 if not self._exclude(files[0]) and not self._exclude(files[1]):
280 self.changes[rev].ren_files[files[0]] = files[1]
281 # Conversion from file to link or from link to file (modified)
282 elif l.startswith('ch'):
283 file = l[2:].strip()
284 if not self._exclude(file):
285 self.changes[rev].mod_files.append(file)
286 # Renamed directory
253 elif l.startswith('/>'): 287 elif l.startswith('/>'):
254 dirs = l[2:].strip().split(' ') 288 dirs = l[2:].strip().split(' ')
255 if len(dirs) == 1: 289 if len(dirs) == 1:
256 dirs = l[2:].strip().split('\t') 290 dirs = l[2:].strip().split('\t')
257 if not self._exclude(dirs[0]) and not self._exclude(dirs[1]): 291 if not self._exclude(dirs[0]) and not self._exclude(dirs[1]):
258 self.changes[rev].ren_dirs[dirs[0]] = dirs[1] 292 self.changes[rev].ren_dirs[dirs[0]] = dirs[1]
259 elif l.startswith('M'):
260 file = l[1:].strip()
261 if not self._exclude(file):
262 self.changes[rev].mod_files.append(file)
263 elif l.startswith('->'):
264 file = l[2:].strip()
265 if not self._exclude(file):
266 self.changes[rev].mod_files.append(file)
267 elif l.startswith('D') and not l.startswith('D/'):
268 file = l[1:].strip()
269 if not self._exclude(file):
270 self.changes[rev].del_files.append(file)
271 elif l.startswith('=>'):
272 files = l[2:].strip().split(' ')
273 if len(files) == 1:
274 files = l[2:].strip().split('\t')
275 if not self._exclude(files[0]) and not self._exclude(files[1]):
276 self.changes[rev].ren_files[files[0]] = files[1]