comparison hgext/convert/cvsps.py @ 7969:a969b1470987

convert: simple fix for non-existent synthetic/mergepoint attributes
author Rocco Rutte <pdmef@gmx.net>
date Sat, 04 Apr 2009 18:08:41 +0200
parents 3e7611a83230
children 3aaca5901ade
comparison
equal deleted inserted replaced
7968:43b70a964e0d 7969:a969b1470987
464 (e.date[0] + e.date[1]) <= 464 (e.date[0] + e.date[1]) <=
465 (c.date[0] + c.date[1]) + fuzz) and 465 (c.date[0] + c.date[1]) + fuzz) and
466 e.file not in files): 466 e.file not in files):
467 c = changeset(comment=e.comment, author=e.author, 467 c = changeset(comment=e.comment, author=e.author,
468 branch=e.branch, date=e.date, entries=[], 468 branch=e.branch, date=e.date, entries=[],
469 mergepoint=e.mergepoint) 469 mergepoint=getattr(e, 'mergepoint', None))
470 changesets.append(c) 470 changesets.append(c)
471 files = {} 471 files = {}
472 if len(changesets) % 100 == 0: 472 if len(changesets) % 100 == 0:
473 t = '%d %s' % (len(changesets), repr(e.comment)[1:-1]) 473 t = '%d %s' % (len(changesets), repr(e.comment)[1:-1])
474 ui.status(util.ellipsis(t, 80) + '\n') 474 ui.status(util.ellipsis(t, 80) + '\n')
486 # changesets: 486 # changesets:
487 # "File file3 was added on branch ..." (synthetic, 1 entry) 487 # "File file3 was added on branch ..." (synthetic, 1 entry)
488 # "File file4 was added on branch ..." (synthetic, 1 entry) 488 # "File file4 was added on branch ..." (synthetic, 1 entry)
489 # "Add file3 and file4 to fix ..." (real, 2 entries) 489 # "Add file3 and file4 to fix ..." (real, 2 entries)
490 # Hence the check for 1 entry here. 490 # Hence the check for 1 entry here.
491 c.synthetic = (len(c.entries) == 1 and c.entries[0].synthetic) 491 synth = getattr(c.entries[0], 'synthetic', None)
492 c.synthetic = (len(c.entries) == 1 and synth)
492 493
493 # Sort files in each changeset 494 # Sort files in each changeset
494 495
495 for c in changesets: 496 for c in changesets:
496 def pathcompare(l, r): 497 def pathcompare(l, r):