Commit 66b17784 by Carlos Andrés Rocha

Merge pull request #6353 from rocha/set-revision-to-unknown-if-not-on-git-repo

Set EDX_PLATFORM_REVISION to unknown if not in a git repo.
parents f91c5ffd 75cfcd72
...@@ -37,7 +37,7 @@ from path import path ...@@ -37,7 +37,7 @@ from path import path
from warnings import simplefilter from warnings import simplefilter
from lms.djangoapps.lms_xblock.mixin import LmsBlockMixin from lms.djangoapps.lms_xblock.mixin import LmsBlockMixin
from dealer.git import git import dealer.git
from xmodule.modulestore.edit_info import EditInfoMixin from xmodule.modulestore.edit_info import EditInfoMixin
############################ FEATURE CONFIGURATION ############################# ############################ FEATURE CONFIGURATION #############################
...@@ -301,7 +301,12 @@ MANAGERS = ADMINS ...@@ -301,7 +301,12 @@ MANAGERS = ADMINS
EDX_PLATFORM_REVISION = os.environ.get('EDX_PLATFORM_REVISION') EDX_PLATFORM_REVISION = os.environ.get('EDX_PLATFORM_REVISION')
if not EDX_PLATFORM_REVISION: if not EDX_PLATFORM_REVISION:
EDX_PLATFORM_REVISION = git.revision try:
# Get git revision of the current file
EDX_PLATFORM_REVISION = dealer.git.Backend(path=REPO_ROOT).revision
except TypeError:
# Not a git repository
EDX_PLATFORM_REVISION = 'unknown'
# Static content # Static content
STATIC_URL = '/static/' + EDX_PLATFORM_REVISION + "/" STATIC_URL = '/static/' + EDX_PLATFORM_REVISION + "/"
......
...@@ -33,7 +33,7 @@ from warnings import simplefilter ...@@ -33,7 +33,7 @@ from warnings import simplefilter
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from .discussionsettings import * from .discussionsettings import *
from dealer.git import git import dealer.git
from xmodule.modulestore.modulestore_settings import update_module_store_settings from xmodule.modulestore.modulestore_settings import update_module_store_settings
from lms.djangoapps.lms_xblock.mixin import LmsBlockMixin from lms.djangoapps.lms_xblock.mixin import LmsBlockMixin
...@@ -688,7 +688,12 @@ MANAGERS = ADMINS ...@@ -688,7 +688,12 @@ MANAGERS = ADMINS
EDX_PLATFORM_REVISION = os.environ.get('EDX_PLATFORM_REVISION') EDX_PLATFORM_REVISION = os.environ.get('EDX_PLATFORM_REVISION')
if not EDX_PLATFORM_REVISION: if not EDX_PLATFORM_REVISION:
EDX_PLATFORM_REVISION = git.revision try:
# Get git revision of the current file
EDX_PLATFORM_REVISION = dealer.git.Backend(path=REPO_ROOT).revision
except TypeError:
# Not a git repository
EDX_PLATFORM_REVISION = 'unknown'
# Static content # Static content
STATIC_URL = '/static/' STATIC_URL = '/static/'
......
...@@ -11,7 +11,7 @@ html5lib==0.999 ...@@ -11,7 +11,7 @@ html5lib==0.999
boto==2.32.1 boto==2.32.1
celery==3.0.19 celery==3.0.19
cssselect==0.9.1 cssselect==0.9.1
dealer==0.2.3 dealer==2.0.4
defusedxml==0.4.1 defusedxml==0.4.1
distribute>=0.6.28, <0.7 distribute>=0.6.28, <0.7
django-babel-underscore==0.1.0 django-babel-underscore==0.1.0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment