Index: __init__.py
===================================================================
--- __init__.py	(revision 5988)
+++ __init__.py	(working copy)
@@ -4,5 +4,6 @@
     "Returns the version as a human-format string."
     v = '.'.join([str(i) for i in VERSION[:-1]])
     if VERSION[-1]:
-        v += '-' + VERSION[-1]
+        from django.utils.version import get_svn_revision
+        v = '%s-%s-%s' % (v, VERSION[-1], get_svn_revision())
     return v
Index: utils/version.py
===================================================================
--- utils/version.py	(revision 0)
+++ utils/version.py	(revision 0)
@@ -0,0 +1,33 @@
+from os import path
+import re
+from xml.dom import minidom
+import django
+
+def get_svn_revision():
+    """
+    Returns the SVN revision in the form SVN-XXXX
+    where XXXX is the revision number.
+
+    Returns SVN-unknown if anything goes wrong.
+    """
+    rev = None
+    entries_path = '%s/.svn/entries' % django.__path__[0]
+
+    if path.exists(entries_path):
+        entries = open(entries_path, 'r').read()
+        # Versions >= 7 of the entries file are flat text.  The first line is 
+        # the version number.  The next set of digits after 'dir' is the revision.
+        if re.match('(\d+)', entries):
+            rev_match = re.search('\d+\s+dir\s+(\d+)', entries)
+            if rev_match:
+                rev = rev_match.groups()[0]
+        # Older XML versions of the file specify revision as an attribute of 
+        # the first entries node.
+        else:
+            dom = minidom.parse(entries_path)
+            rev = dom.getElementsByTagName('entry')[0].getAttribute('revision')
+
+    if rev:
+        return u'SVN-%s' % rev
+    return u'SVN-unknown'
+
