Ticket #6655: svnrevision.patch
File svnrevision.patch, 797 bytes (added by , 17 years ago) |
---|
-
django/utils/version.py
15 15 directory. 16 16 """ 17 17 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') 21 19 22 20 if os.path.exists(entries_path): 23 21 entries = open(entries_path, 'r').read() … … 34 32 dom = minidom.parse(entries_path) 35 33 rev = dom.getElementsByTagName('entry')[0].getAttribute('revision') 36 34 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'