Ticket #6655: svnrevision.patch

File svnrevision.patch, 797 bytes (added by Ivan Illarionov, 17 years ago)
  • django/utils/version.py

     
    1515    directory.
    1616    """
    1717    rev = None
    18     if path is None:
    19         path = django.__path__[0]
    20     entries_path = '%s/.svn/entries' % path
     18    entries_path = os.path.join(path or django.__path__[0], '.svn', 'entries')
    2119
    2220    if os.path.exists(entries_path):
    2321        entries = open(entries_path, 'r').read()
     
    3432            dom = minidom.parse(entries_path)
    3533            rev = dom.getElementsByTagName('entry')[0].getAttribute('revision')
    3634
    37     if rev:
    38         return u'SVN-%s' % rev
    39     return u'SVN-unknown'
     35    return rev and u'SVN-%s' % rev or u'SVN-unknown'
Back to Top