import functools
import subprocess
import django
import platform
from django.conf import settings
from django.contrib.sites.models import get_current_site


def system_info(request):
    return {
        'system': {
            'django': django.get_version(),
            'python': platform.python_version(),
            'website': get_website_version(),
        }
    }


def current_site(request):
    return {
        'site': get_current_site(request),
    }


@functools.lru_cache(maxsize=1)
def get_website_version():
    command = 'hg tip --template {node}'
    process = subprocess.Popen(command.split(), stdout=subprocess.PIPE, cwd=settings.PROJECT_ROOT)
    return process.communicate()[0]

import functools
import subprocess
import django
import platform
from django.conf import settings
from django.contrib.sites.models import get_current_site


def system_info(request):
    return {
        'system': {
            'django': django.get_version(),
            'python': platform.python_version(),
            'website': get_website_version(),
        }
    }


def current_site(request):
    return {
        'site': get_current_site(request),
    }


@functools.lru_cache(maxsize=1)
def get_website_version():
    command = 'git rev-parse HEAD'
    process = subprocess.Popen(command.split(), stdout=subprocess.PIPE, cwd=settings.PROJECT_ROOT)
    return process.communicate()[0]

Change from hg to git.
Change from hg to git.

  import functools
  import subprocess
  import django
  import platform
  from django.conf import settings
  from django.contrib.sites.models import get_current_site
  
  
  def system_info(request):
      return {
          'system': {
              'django': django.get_version(),
              'python': platform.python_version(),
              'website': get_website_version(),
          }
      }
  
  
  def current_site(request):
      return {
          'site': get_current_site(request),
      }
  
  
  @functools.lru_cache(maxsize=1)
  def get_website_version():
-     command = 'hg tip --template {node}'
+     command = 'git rev-parse HEAD'
      process = subprocess.Popen(command.split(), stdout=subprocess.PIPE, cwd=settings.PROJECT_ROOT)
      return process.communicate()[0]
  
Change from hg to git.
## Code Before:
import functools
import subprocess
import django
import platform
from django.conf import settings
from django.contrib.sites.models import get_current_site


def system_info(request):
    return {
        'system': {
            'django': django.get_version(),
            'python': platform.python_version(),
            'website': get_website_version(),
        }
    }


def current_site(request):
    return {
        'site': get_current_site(request),
    }


@functools.lru_cache(maxsize=1)
def get_website_version():
    command = 'hg tip --template {node}'
    process = subprocess.Popen(command.split(), stdout=subprocess.PIPE, cwd=settings.PROJECT_ROOT)
    return process.communicate()[0]

## Instruction:
Change from hg to git.
## Code After:
import functools
import subprocess
import django
import platform
from django.conf import settings
from django.contrib.sites.models import get_current_site


def system_info(request):
    return {
        'system': {
            'django': django.get_version(),
            'python': platform.python_version(),
            'website': get_website_version(),
        }
    }


def current_site(request):
    return {
        'site': get_current_site(request),
    }


@functools.lru_cache(maxsize=1)
def get_website_version():
    command = 'git rev-parse HEAD'
    process = subprocess.Popen(command.split(), stdout=subprocess.PIPE, cwd=settings.PROJECT_ROOT)
    return process.communicate()[0]
