Mercurial > hg
comparison hgext/convert/cvsps.py @ 10701:35893dcfd40c stable
cvsps: fix traceback involving 'synthetic'
https://bugzilla.redhat.com/show_bug.cgi?id=573666
Reported by Sjoerd Mullender
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Mon, 15 Mar 2010 19:55:52 +0100 |
parents | b4b16e90712f |
children | 9f6731b03906 |
comparison
equal
deleted
inserted
replaced
10698:e930017f9e2a | 10701:35893dcfd40c |
---|---|
30 .mergepoint- the branch that has been merged from | 30 .mergepoint- the branch that has been merged from |
31 (if present in rlog output) | 31 (if present in rlog output) |
32 .branchpoints- the branches that start at the current entry | 32 .branchpoints- the branches that start at the current entry |
33 ''' | 33 ''' |
34 def __init__(self, **entries): | 34 def __init__(self, **entries): |
35 self.synthetic = False | |
35 self.__dict__.update(entries) | 36 self.__dict__.update(entries) |
36 | 37 |
37 def __repr__(self): | 38 def __repr__(self): |
38 return "<%s at 0x%x: %s %s>" % (self.__class__.__name__, | 39 return "<%s at 0x%x: %s %s>" % (self.__class__.__name__, |
39 id(self), | 40 id(self), |
294 # as this state is re-entered for subsequent revisions of a file. | 295 # as this state is re-entered for subsequent revisions of a file. |
295 match = re_50.match(line) | 296 match = re_50.match(line) |
296 assert match, _('expected revision number') | 297 assert match, _('expected revision number') |
297 e = logentry(rcs=scache(rcs), file=scache(filename), | 298 e = logentry(rcs=scache(rcs), file=scache(filename), |
298 revision=tuple([int(x) for x in match.group(1).split('.')]), | 299 revision=tuple([int(x) for x in match.group(1).split('.')]), |
299 branches=[], parent=None, | 300 branches=[], parent=None) |
300 synthetic=False) | |
301 state = 6 | 301 state = 6 |
302 | 302 |
303 elif state == 6: | 303 elif state == 6: |
304 # expecting date, author, state, lines changed | 304 # expecting date, author, state, lines changed |
305 match = re_60.match(line) | 305 match = re_60.match(line) |
467 .mergepoint- the branch that has been merged from | 467 .mergepoint- the branch that has been merged from |
468 (if present in rlog output) | 468 (if present in rlog output) |
469 .branchpoints- the branches that start at the current entry | 469 .branchpoints- the branches that start at the current entry |
470 ''' | 470 ''' |
471 def __init__(self, **entries): | 471 def __init__(self, **entries): |
472 self.synthetic = False | |
472 self.__dict__.update(entries) | 473 self.__dict__.update(entries) |
473 | 474 |
474 def __repr__(self): | 475 def __repr__(self): |
475 return "<%s at 0x%x: %s>" % (self.__class__.__name__, | 476 return "<%s at 0x%x: %s>" % (self.__class__.__name__, |
476 id(self), | 477 id(self), |
540 # changesets: | 541 # changesets: |
541 # "File file3 was added on branch ..." (synthetic, 1 entry) | 542 # "File file3 was added on branch ..." (synthetic, 1 entry) |
542 # "File file4 was added on branch ..." (synthetic, 1 entry) | 543 # "File file4 was added on branch ..." (synthetic, 1 entry) |
543 # "Add file3 and file4 to fix ..." (real, 2 entries) | 544 # "Add file3 and file4 to fix ..." (real, 2 entries) |
544 # Hence the check for 1 entry here. | 545 # Hence the check for 1 entry here. |
545 synth = getattr(c.entries[0], 'synthetic', None) | 546 c.synthetic = len(c.entries) == 1 and c.entries[0].synthetic |
546 c.synthetic = (len(c.entries) == 1 and synth) | |
547 | 547 |
548 # Sort files in each changeset | 548 # Sort files in each changeset |
549 | 549 |
550 for c in changesets: | 550 for c in changesets: |
551 def pathcompare(l, r): | 551 def pathcompare(l, r): |