Changeset 213 in tracdarcs


Ignore:
Timestamp:
10/25/10 12:06:14 (3 years ago)
Author:
Dave Love <fx@…>
Hash name:
20101025100614-d4134-206545bccfbf25cc483ad5a473de727c8714abc2
Message:

Add get_path_url repository method.
Provides a "Repository URL" link in source browser.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tracdarcs/repository.py

    r209 r213  
    263263                i += 1 
    264264 
     265    def get_path_url(self, path, rev): 
     266        url = self.params.get('url', '').rstrip('/') 
     267        if url: 
     268            if not path or path == '/': 
     269                return url 
     270            return url + '/' + path.lstrip('/') 
     271 
    265272class DarcsNode(Node): 
    266273    """Implement darcs specific logic around a ``Node``.""" 
Note: See TracChangeset for help on using the changeset viewer.