Commits

Rob Golding committed 8b7e9bc

Added settings file which raises ImproperlyConfigured if HGREV_HG_PATH is not defined.

  • Participants
  • Parent commits c8bee59

Comments (0)

Files changed (2)

File hgrev/settings.py

+from django.core.exceptions import ImproperlyConfigured
+from django.conf import settings
+
+HGREV_HG_PATH = getattr(settings, 'HGREV_HG_PATH', None)
+
+if HGREV_HG_PATH is None:
+	raise ImproperlyConfigured, "You need to define HGREV_HG_PATH in your settings.py file"

File hgrev/templatetags/__init__.py

+from hgrev import settings
+
 def get_revision():
 	from mercurial import ui, hg
 	
-	repo = hg.repository(ui.ui(), '.')
+	repo = hg.repository(ui.ui(), settings.HGREV_HG_PATH)
 	
 	fctx = repo.filectx(None, 'tip')