Ticket #5237: django_patch_get_svn_revision_01.patch

File django_patch_get_svn_revision_01.patch, 825 bytes (added by django@…, 17 years ago)

add optional path argument

  • external/django/utils/version.py

     
    22import os.path
    33import re
    44
    5 def get_svn_revision():
     5def get_svn_revision(path=None):
    66    """
    77    Returns the SVN revision in the form SVN-XXXX,
    88    where XXXX is the revision number.
     
    1111    format of internal SVN files.
    1212    """
    1313    rev = None
    14     entries_path = '%s/.svn/entries' % django.__path__[0]
     14    if not path:
     15        path = django.__path__[0]
    1516
     17    entries_path = '%s/.svn/entries' % path
     18
    1619    if os.path.exists(entries_path):
    1720        entries = open(entries_path, 'r').read()
    1821        # Versions >= 7 of the entries file are flat text.  The first line is
Back to Top