Mercurial > hg
comparison hgext/convert/gnuarch.py @ 6079:ea34059b89de
convert: added GNU Arch (tla) tests and related fixes
author | Aleix Conchillo Flaque <aleix@member.fsf.org> |
---|---|
date | Tue, 12 Feb 2008 11:35:06 +0100 |
parents | ebc23d34102f |
children | 81a8667331e8 |
comparison
equal
deleted
inserted
replaced
6078:ebc23d34102f | 6079:ea34059b89de |
---|---|
225 self.checkexit(output) | 225 self.checkexit(output) |
226 self.ui.debug(_('analysing revision %s...\n' % rev)) | 226 self.ui.debug(_('analysing revision %s...\n' % rev)) |
227 files = self._readcontents(self.tmppath) | 227 files = self._readcontents(self.tmppath) |
228 self.changes[rev].add_files += files | 228 self.changes[rev].add_files += files |
229 | 229 |
230 def _stripbasepath(self, path): | |
231 if path.startswith('./'): | |
232 return path[2:] | |
233 return path | |
234 | |
230 def _parsecatlog(self, data, rev): | 235 def _parsecatlog(self, data, rev): |
231 summary = [] | 236 summary = [] |
232 for l in data: | 237 for l in data: |
233 l = l.strip() | 238 l = l.strip() |
234 if summary: | 239 if summary: |
246 def _parsechangeset(self, data, rev): | 251 def _parsechangeset(self, data, rev): |
247 for l in data: | 252 for l in data: |
248 l = l.strip() | 253 l = l.strip() |
249 # Added file (ignore added directory) | 254 # Added file (ignore added directory) |
250 if l.startswith('A') and not l.startswith('A/'): | 255 if l.startswith('A') and not l.startswith('A/'): |
251 file = l[1:].strip() | 256 file = self._stripbasepath(l[1:].strip()) |
252 if not self._exclude(file): | 257 if not self._exclude(file): |
253 self.changes[rev].add_files.append(file) | 258 self.changes[rev].add_files.append(file) |
254 # Deleted file (ignore deleted directory) | 259 # Deleted file (ignore deleted directory) |
255 elif l.startswith('D') and not l.startswith('D/'): | 260 elif l.startswith('D') and not l.startswith('D/'): |
256 file = l[1:].strip() | 261 file = self._stripbasepath(l[1:].strip()) |
257 if not self._exclude(file): | 262 if not self._exclude(file): |
258 self.changes[rev].del_files.append(file) | 263 self.changes[rev].del_files.append(file) |
259 # Modified binary file | 264 # Modified binary file |
260 elif l.startswith('Mb'): | 265 elif l.startswith('Mb'): |
261 file = l[2:].strip() | 266 file = self._stripbasepath(l[2:].strip()) |
262 if not self._exclude(file): | 267 if not self._exclude(file): |
263 self.changes[rev].mod_files.append(file) | 268 self.changes[rev].mod_files.append(file) |
264 # Modified link | 269 # Modified link |
265 elif l.startswith('M->'): | 270 elif l.startswith('M->'): |
266 file = l[3:].strip() | 271 file = self._stripbasepath(l[3:].strip()) |
267 if not self._exclude(file): | 272 if not self._exclude(file): |
268 self.changes[rev].mod_files.append(file) | 273 self.changes[rev].mod_files.append(file) |
269 # Modified file | 274 # Modified file |
270 elif l.startswith('M'): | 275 elif l.startswith('M'): |
271 file = l[1:].strip() | 276 file = self._stripbasepath(l[1:].strip()) |
272 if not self._exclude(file): | 277 if not self._exclude(file): |
273 self.changes[rev].mod_files.append(file) | 278 self.changes[rev].mod_files.append(file) |
274 # Renamed file (or link) | 279 # Renamed file (or link) |
275 elif l.startswith('=>'): | 280 elif l.startswith('=>'): |
276 files = l[2:].strip().split(' ') | 281 files = l[2:].strip().split(' ') |
277 if len(files) == 1: | 282 if len(files) == 1: |
278 files = l[2:].strip().split('\t') | 283 files = l[2:].strip().split('\t') |
279 if not self._exclude(files[0]) and not self._exclude(files[1]): | 284 src = self._stripbasepath(files[0]) |
280 self.changes[rev].ren_files[files[0]] = files[1] | 285 dst = self._stripbasepath(files[1]) |
286 if not self._exclude(src) and not self._exclude(dst): | |
287 self.changes[rev].ren_files[src] = dst | |
281 # Conversion from file to link or from link to file (modified) | 288 # Conversion from file to link or from link to file (modified) |
282 elif l.startswith('ch'): | 289 elif l.startswith('ch'): |
283 file = l[2:].strip() | 290 file = self._stripbasepath(l[2:].strip()) |
284 if not self._exclude(file): | 291 if not self._exclude(file): |
285 self.changes[rev].mod_files.append(file) | 292 self.changes[rev].mod_files.append(file) |
286 # Renamed directory | 293 # Renamed directory |
287 elif l.startswith('/>'): | 294 elif l.startswith('/>'): |
288 dirs = l[2:].strip().split(' ') | 295 dirs = l[2:].strip().split(' ') |
289 if len(dirs) == 1: | 296 if len(dirs) == 1: |
290 dirs = l[2:].strip().split('\t') | 297 dirs = l[2:].strip().split('\t') |
291 if not self._exclude(dirs[0]) and not self._exclude(dirs[1]): | 298 src = self._stripbasepath(dirs[0]) |
292 self.changes[rev].ren_dirs[dirs[0]] = dirs[1] | 299 dst = self._stripbasepath(dirs[1]) |
300 if not self._exclude(src) and not self._exclude(dst): | |
301 self.changes[rev].ren_dirs[src] = dst |