Changeset 94 in tailor


Ignore:
Timestamp:
07/16/04 17:36:39 (9 years ago)
Author:
lele@…
Hash name:
20040716153639-97f81-60e2b69eaa75bcb07f05b61e78d77411f25dd2b3
Message:

Better way to identify new entries from the CVS log
The CVS revision info given by its log command usually looks like

date: 2004/05/22 16:52:55; author: tiran; state: Exp; lines: +2 -2

The last field summarize the changes made to an existing file; if it's
missing, this means it's a new entry.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vcpx/cvs.py

    r93 r94  
    185185 
    186186        state = info[2].strip()[7:] 
     187 
     188        # Fourth element, if present and like "lines +x -y", indicates 
     189        # this is a change to an existing file. Otherwise its a new 
     190        # one. 
     191 
     192        newentry = not info[3].strip().startswith('lines: ') 
    187193         
    188194        # The next line may be either the first of the changelog or a 
     
    207213            changelog = '\n'.join(mesg) 
    208214             
    209         return (date, author, changelog, entry, rev, state) 
     215        return (date, author, changelog, entry, rev, state, newentry) 
    210216     
    211217    def __parseCvsLog(self, log): 
     
    232238            selected = selected.strip() 
    233239 
    234             # If the log shows all changes to the entry, than it's 
    235             # a new one 
    236              
    237             newentry = total.split(':')[1] == selected.split(':')[1] 
    238              
    239240            l = log.readline() 
    240241            while l and l <> '----------------------------\n': 
     
    243244            cs = self.__parseRevision(entry, log) 
    244245            while cs: 
    245                 date,author,changelog,e,rev,state = cs 
     246                date,author,changelog,e,rev,state,newentry = cs 
    246247 
    247248                last = self.__collect(date, author, changelog, e, rev) 
    248249                if state == 'dead': 
    249250                    last.action_kind = last.DELETED 
     251                elif newentry: 
     252                    last.action_kind = last.ADDED 
    250253                else: 
    251254                    last.action_kind = last.UPDATED 
    252255                 
    253256                cs = self.__parseRevision(entry, log) 
    254  
    255             if newentry: 
    256                 last.action_kind = last.ADDED 
    257257         
    258258 
Note: See TracChangeset for help on using the changeset viewer.