Ticket #5237: django_patch_get_svn_revision_01.patch
File django_patch_get_svn_revision_01.patch, 825 bytes (added by , 17 years ago) |
---|
-
external/django/utils/version.py
2 2 import os.path 3 3 import re 4 4 5 def get_svn_revision( ):5 def get_svn_revision(path=None): 6 6 """ 7 7 Returns the SVN revision in the form SVN-XXXX, 8 8 where XXXX is the revision number. … … 11 11 format of internal SVN files. 12 12 """ 13 13 rev = None 14 entries_path = '%s/.svn/entries' % django.__path__[0] 14 if not path: 15 path = django.__path__[0] 15 16 17 entries_path = '%s/.svn/entries' % path 18 16 19 if os.path.exists(entries_path): 17 20 entries = open(entries_path, 'r').read() 18 21 # Versions >= 7 of the entries file are flat text. The first line is