def createMirroredRepo(self):
    if (self._moveAside and os.path.exists(self._path)):
        parentPath = os.path.dirname(self._path)
        dirContents = str(os.listdir(parentPath)).encode('utf8')
        newNameExt = hashlib.md5(dirContents).hexdigest()
        newName = (((self._path + '_') + newNameExt) + '_bu')
        print('MOVING PATH', self._path, newName)
        shutil.move(self._path, newName)
    elif (self._overwrite and os.path.exists(self._path)):
        print('REMOVING PATH', self._path)
        shutil.rmtree(self._path)
    else:
        assert (not os.path.exists(self._path)), 'ERROR: the supplied path already exists, unable to create mirror.'
    os.makedirs(self._path)
    os.chdir(self._path)
    cmd = subprocess.Popen((('git clone --mirror ' + str(self._origin_url)) + ' .'), shell=True, stdout=subprocess.PIPE)
    cmd.wait()
    print('SUCCESS (new mirror)')
def createMirroredRepo(self):
    if (self._moveAside and os.path.exists(self._path)):
        parentPath = os.path.dirname(self._path)
        dirContents = str(os.listdir(parentPath)).encode('utf8')
        newNameExt = hashlib.md5(dirContents).hexdigest()
        newName = (((self._path + '_') + newNameExt) + '_bu')
        print('MOVING PATH', self._path, newName)
        shutil.move(self._path, newName)
    elif (self._overwrite and os.path.exists(self._path)):
        print('REMOVING PATH', self._path)
        shutil.rmtree(self._path)
    else:
        assert (not os.path.exists(self._path)), 'ERROR: the supplied path already exists, unable to create mirror.'
    os.makedirs(self._path)
    os.chdir(self._path)
    cmd = subprocess.Popen((('git clone --mirror ' + str(self._origin_url)) + ' .'), shell=True, stdout=subprocess.PIPE)
    cmd.wait()
    print('SUCCESS (new mirror)')