Changeset 4847

Show
Ignore:
Timestamp:
11/19/08 13:12:38 (2 months ago)
Author:
eblot
Message:

Fix up Tags management:

  • Proper positioning of the tag label when a branch is tagged multiple times
  • Do not show deleted tags
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • revtreeplugin/0.11/revtree/model.py

    r4697 r4847  
    197197                                (info['kind'], info['path'])) 
    198198            return False 
     199        path_mo = bcre.match(info['path']) 
     200        if info['change'] is TracChangeset.DELETE: 
     201            mo_dict = path_mo.groupdict() 
     202            if 'tag' not in mo_dict: 
     203                return False 
     204            self.name = mo_dict['tag'] 
     205            self.env.log.info('Tag: deleted %s' % info['path']) 
     206            self.last = True 
     207            return True  
    199208        if info['change'] is not TracChangeset.COPY: 
    200209            self.env.log.warn('Tag: not a copy: %s: %s' % \ 
    201210                                (info['change'], info['path'])) 
    202211            return False 
    203         path_mo = bcre.match(info['path']) 
    204212        if not path_mo: # or not src_mo: 
    205213            self.env.log.warn('Tag: with path: %s <- %s' % \ 
     
    339347            elif isinstance(chgset, TagChangeset): 
    340348                if self._tags.has_key(chgset.name): 
     349                    if chgset.last: 
     350                        self.log.info('Removing deleted tag %s' % chgset.name) 
     351                        del self._tags[chgset.name] 
     352                        continue 
    341353                    self.log.warn('Ubiquitous tag: %s', chgset.name) 
    342354                self._tags[chgset.name] = chgset  
  • revtreeplugin/0.11/revtree/svgview.py

    r4024 r4847  
    204204        self._shape = 'circle' 
    205205        self._enhance = False 
     206        self._tag_offset = 0 
    206207        self._fillcolor = self._parent.fillcolor() 
    207208        self._strokecolor = self._parent.strokecolor() 
     
    291292            self._link.attributes['class'] = ' '.join(self._classes) 
    292293                     
     294    def tag_offset(self, height): 
     295        offset = self._tag_offset 
     296        self._tag_offset += height 
     297        return offset 
     298 
    293299    def strokewidth(self): 
    294300        return self._parent.strokewidth() 
     
    398404        return (self._w, self._h) 
    399405         
    400     def build(self, h_offset): 
     406    def build(self): 
    401407        (sx, sy) = self._srcchgset.position() 
     408        h_offset = self._srcchgset.tag_offset(self._h) 
    402409        self._position = (sx + (self._srcchgset.extent()[0])/2, 
    403410                          sy - (3*self._h)/2 + h_offset) 
     
    506513                       
    507514    def build(self, position): 
    508         tag_h_off = 0 
    509515        self._position = position 
    510516        self._slot = self._slotgen() 
     
    516522                    wdgt.build() 
    517523                    h += wdgt.extent()[1] 
    518                 else: 
    519                     wdgt.build(tag_h_off
     524                else:  
     525                    wdgt.build(
    520526                    (tw, th) = wdgt.extent() 
    521                     tag_h_off -= th 
    522527                    nw = tw/2 + wdgt.position()[0]-position[0] 
    523528                    if nw > w: w = nw  
  • revtreeplugin/0.11/setup.py

    r4697 r4847  
    1616 
    1717PACKAGE = 'TracRevtreePlugin' 
    18 VERSION = '0.6.2
     18VERSION = '0.6.3
    1919 
    2020setup (