Changeset 865 in tailor


Ignore:
Timestamp:
10/02/05 23:20:50 (8 years ago)
Author:
lele@…
Hash name:
20051002212050-97f81-4a825b665bae966f0bd94786081f61137ee14299
Message:

Collapse multiple deletions on a single file under cvs
This should fix #7, that reported a strange case where cvs log says
a single file has two revisions, by the same author and with the same
timestamp, both deleting the file.

Location:
vcpx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • vcpx/cvs.py

    r854 r865  
    123123        key = (timestamp, author, changelog) 
    124124        if self.changesets.has_key(key): 
    125             return self.changesets[key].addEntry(entry, revision) 
     125            cs = self.changesets[key] 
     126            for e in cs.entries: 
     127                if e.name == entry: 
     128                    return e 
     129            return cs.addEntry(entry, revision) 
    126130        else: 
    127131            cs = Changeset(_getGlobalCVSRevision(timestamp, author), 
     
    281285 
    282286                if previous and last.action_kind == last.DELETED: 
    283                     previous.action_kind = previous.ADDED 
     287                    # For unknown reasons, sometimes there are two dead 
     288                    # revision is a row. 
     289                    if previous.action_kind <> last.DELETED: 
     290                        previous.action_kind = previous.ADDED 
    284291 
    285292                previous = last 
  • vcpx/tests/cvs.py

    r781 r865  
    929929        self.assertRaises(UnicodeEncodeError, log.encode, 'ascii') 
    930930        self.assertEqual(len(log.encode('ascii', 'ignore')), 41) 
     931 
     932    DOUBLE_DEAD_TEST = """\ 
     933cvs rlog: Logging composestar/temp/ComposestarVSAddin/ComposestarVSAddin 
     934 
     935RCS file: /cvsroot/composestar/composestar/temp/ComposestarVSAddin/Attic/Ini.cs,v 
     936head: 1.3 
     937branch: 
     938locks: strict 
     939access list: 
     940keyword substitution: kv 
     941total revisions: 3;     selected revisions: 3 
     942description: 
     943---------------------------- 
     944revision 1.3 
     945date: 2004/07/15 08:28:02;  author: sverre_boschman;  state: dead;  lines: +0 -0 
     946*** empty log message *** 
     947---------------------------- 
     948revision 1.2 
     949date: 2004/07/15 08:28:02;  author: sverre_boschman;  state: dead;  lines: +0 -0 
     950*** empty log message *** 
     951---------------------------- 
     952revision 1.1 
     953date: 2004/07/14 15:39:55;  author: sverre_boschman;  state: Exp; 
     954Backup 
     955============================================================================= 
     956""" 
     957 
     958    def testDoubleDead(self): 
     959        """Verify the parser collapse multiple deletions on a single entry""" 
     960 
     961        log = StringIO(self.DOUBLE_DEAD_TEST) 
     962        csets = changesets_from_cvslog(log, 'composestar') 
     963 
     964        self.assertEqual(len(csets), 2) 
     965 
     966        cset = csets[0] 
     967        self.assertEqual(len(cset.entries), 1) 
     968        entry = cset.entries[0] 
     969        self.assertEqual(entry.name, 'temp/ComposestarVSAddin/ComposestarVSAddin/Ini.cs') 
     970        self.assertEqual(entry.new_revision, '1.1') 
     971        self.assertEqual(entry.action_kind, entry.ADDED) 
     972 
     973        cset = csets[1] 
     974        self.assertEqual(len(cset.entries), 1) 
     975        entry = cset.entries[0] 
     976        self.assertEqual(entry.name, 'temp/ComposestarVSAddin/ComposestarVSAddin/Ini.cs') 
     977        self.assertEqual(entry.new_revision, '1.3') 
     978        self.assertEqual(entry.action_kind, entry.DELETED) 
     979 
Note: See TracChangeset for help on using the changeset viewer.