# Path: jirafs/utils.py
# def convert_to_boolean(string):
# def stash_local_changes(repo):
# def get_user_input(message, options=None, boolean=False, password=False):
# def run_command_method_with_kwargs(command, method=None, **kwargs):
# def get_installed_commands():
# def get_installed_plugins(subclass=Plugin):
# def get_config_path(filename):
# def get_config(additional_configs=None, include_global=True):
# def set_global_config_value(section, key, value):
# def get_default_jira_server(config=None):
# def get_jira(domain=None, config=None):
#     def get_section(config, domain):
# def get_git_version():
# def lazy_get_jira():
# def format_date(folder, date):
# def find_files_referenced_in_markup(markup: str) -> Dict[str, Tuple[str, int, int]]:
# def get_comment_author_display(comment: Comment) -> Optional[str]:
# 
# Path: jirafs/exceptions.py
# class GitCommandError(JirafsError):
#     def __init__(self, *args, **kwargs):
#         self._command = kwargs.pop("cmd", None)
#         self._returncode = kwargs.pop("returncode", None)
#         self._output = kwargs.pop("stdout", None)
# 
#         super(GitCommandError, self).__init__(*args, **kwargs)
# 
#     @property
#     def command(self):
#         return self._command
# 
#     @property
#     def returncode(self):
#         return self._returncode
# 
#     @property
#     def output(self):
#         return self._output


import json
import os
import shutil
import subprocess
from urllib import parse
from . import utils
from .exceptions import GitCommandError
    repo.run_git_command("commit", "--allow-empty", "-m", "Shadow Created", shadow=True)
    repo.run_git_command("push", "-f", "origin", "jira", shadow=True)
    repo.run_git_command("merge", "jira")

    set_repo_version(repo, 11)


def migration_0012(repo, init=False, **kwargs):
    """Force the shadow repository to use a relative URL."""
    subprocess.check_call(
        ("git", "remote", "set-url", "origin", "../git"),
        cwd=repo.get_metadata_path("shadow"),
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE,
    )

    set_repo_version(repo, 12)


def migration_0013(repo, init=False, **kwargs):
    """Ensure that folder URL is written to issue_url file."""
    if init:
        set_repo_version(repo, 13)
        return

    result = repo.get_ticket_url()
    if result is not None:
        set_repo_version(repo, 13)
        return


# Path: jirafs/utils.py
# def convert_to_boolean(string):
# def stash_local_changes(repo):
# def get_user_input(message, options=None, boolean=False, password=False):
# def run_command_method_with_kwargs(command, method=None, **kwargs):
# def get_installed_commands():
# def get_installed_plugins(subclass=Plugin):
# def get_config_path(filename):
# def get_config(additional_configs=None, include_global=True):
# def set_global_config_value(section, key, value):
# def get_default_jira_server(config=None):
# def get_jira(domain=None, config=None):
#     def get_section(config, domain):
# def get_git_version():
# def lazy_get_jira():
# def format_date(folder, date):
# def find_files_referenced_in_markup(markup: str) -> Dict[str, Tuple[str, int, int]]:
# def get_comment_author_display(comment: Comment) -> Optional[str]:
# 
# Path: jirafs/exceptions.py
# class GitCommandError(JirafsError):
#     def __init__(self, *args, **kwargs):
#         self._command = kwargs.pop("cmd", None)
#         self._returncode = kwargs.pop("returncode", None)
#         self._output = kwargs.pop("stdout", None)
# 
#         super(GitCommandError, self).__init__(*args, **kwargs)
# 
#     @property
#     def command(self):
#         return self._command
# 
#     @property
#     def returncode(self):
#         return self._returncode
# 
#     @property
#     def output(self):
#         return self._output


# Path: jirafs/migrations.py
import json
import os
import shutil
import subprocess
from urllib import parse
from . import utils
from .exceptions import GitCommandError

    repo.run_git_command("commit", "--allow-empty", "-m", "Shadow Created", shadow=True)
    repo.run_git_command("push", "-f", "origin", "jira", shadow=True)
    repo.run_git_command("merge", "jira")

    set_repo_version(repo, 11)


def migration_0012(repo, init=False, **kwargs):
    """Force the shadow repository to use a relative URL."""
    subprocess.check_call(
        ("git", "remote", "set-url", "origin", "../git"),
        cwd=repo.get_metadata_path("shadow"),
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE,
    )

    set_repo_version(repo, 12)


def migration_0013(repo, init=False, **kwargs):
    """Ensure that folder URL is written to issue_url file."""
    if init:
        set_repo_version(repo, 13)
        return

    result = repo.get_ticket_url()
    if result is not None:
        set_repo_version(repo, 13)
        return


    jira_base = utils.get_default_jira_server()