# Path: jirafs/constants.py
# TICKET_DETAILS = "fields.jira"
# TICKET_COMMENTS = "comments.read_only.jira"
# TICKET_NEW_COMMENT = "new_comment.jira"
# TICKET_LINKS = "links.jira"
# TICKET_FILE_FIELD_TEMPLATE = u"{field_name}.jira"
# LOCAL_ONLY_FILE = ".jirafs_local"
# REMOTE_IGNORE_FILE = ".jirafs_remote_ignore"
# GIT_IGNORE_FILE_PARTIAL = ".jirafs_ignore"
# GIT_IGNORE_FILE = ".jirafs/combined_ignore"
# GIT_EXCLUDE_FILE = ".jirafs/git/info/exclude"
# TICKET_OPERATION_LOG = "operation.log"
# METADATA_DIR = ".jirafs"
# GLOBAL_CONFIG = ".jirafs_config"
# TEMP_GENERATED_FILES = ".jirafs/temp-generated"
# GIT_AUTHOR = "Jirafs %s <jirafs@localhost>" % (version)
# DEFAULT_BRANCH = "master"
# CONFIG_JIRA = "jira"
# CONFIG_MAIN = "main"
# CONFIG_PLUGINS = "plugins"
# NO_DETAIL_FIELDS = ["comment", "watches", "attachment"]
# FILE_FIELDS = [
#     "description",
# ]
# FILE_FIELD_BLACKLIST = [
#     "new_comment",
#     "fields",
#     "links",
# ]
# ALLOW_USER_INPUT = True
# DEFAULT_DATE_FORMAT = "%Y-%m-%d at %H:%M:%S %Z"
# CURRENT_REPO_VERSION = 17
# 
# Path: jirafs/readers.py
# class GitRevisionReader(object):
#     def __init__(self, folder, revision):
#         self.folder = folder
#         self.revision = revision
#         super(GitRevisionReader, self).__init__()
# 
#     def get_file_contents(self, path):
#         try:
#             return self.folder.get_local_file_at_revision(
#                 path, self.revision, failure_ok=False
#             )
#         except GitCommandError:
#             return ""
# 
# class WorkingCopyReader(object):
#     def __init__(self, folder, path):
#         self.folder = folder
#         self.path = path
#         super(WorkingCopyReader, self).__init__()
# 
#     def get_file_contents(self, path):
#         full_path = os.path.join(self.path, path)
# 
#         with io.open(
#             self.folder.get_local_path(full_path), "r", encoding="utf-8"
#         ) as _in:
#             return _in.read().strip()


import io
import json
import os
import re
from jirafs import constants
from jirafs.readers import GitRevisionReader, WorkingCopyReader
            return self.folder.process_macros(
                self[field_name], path=self.get_generated_file_path()
            )
        except KeyError:
            return default

    @classmethod
    def create(cls, folder, revision=None, path=None):
        if revision and path:
            raise TypeError("You may specify a git revision or a local path; not both.")

        if revision:
            return GitRevisionJiraFieldManager(folder, revision)
        else:
            return WorkingCopyJiraFieldManager(folder, path)

    def get_requested_per_ticket_fields(self):
        return constants.FILE_FIELDS

    def get_used_per_ticket_fields(self):
        raise NotImplementedError()

    def get_field_data_files(self):
        all_files = [
            constants.TICKET_DETAILS,
        ]

        try:
            for field in self.get_used_per_ticket_fields():
                all_files.append(

# Path: jirafs/constants.py
# TICKET_DETAILS = "fields.jira"
# TICKET_COMMENTS = "comments.read_only.jira"
# TICKET_NEW_COMMENT = "new_comment.jira"
# TICKET_LINKS = "links.jira"
# TICKET_FILE_FIELD_TEMPLATE = u"{field_name}.jira"
# LOCAL_ONLY_FILE = ".jirafs_local"
# REMOTE_IGNORE_FILE = ".jirafs_remote_ignore"
# GIT_IGNORE_FILE_PARTIAL = ".jirafs_ignore"
# GIT_IGNORE_FILE = ".jirafs/combined_ignore"
# GIT_EXCLUDE_FILE = ".jirafs/git/info/exclude"
# TICKET_OPERATION_LOG = "operation.log"
# METADATA_DIR = ".jirafs"
# GLOBAL_CONFIG = ".jirafs_config"
# TEMP_GENERATED_FILES = ".jirafs/temp-generated"
# GIT_AUTHOR = "Jirafs %s <jirafs@localhost>" % (version)
# DEFAULT_BRANCH = "master"
# CONFIG_JIRA = "jira"
# CONFIG_MAIN = "main"
# CONFIG_PLUGINS = "plugins"
# NO_DETAIL_FIELDS = ["comment", "watches", "attachment"]
# FILE_FIELDS = [
#     "description",
# ]
# FILE_FIELD_BLACKLIST = [
#     "new_comment",
#     "fields",
#     "links",
# ]
# ALLOW_USER_INPUT = True
# DEFAULT_DATE_FORMAT = "%Y-%m-%d at %H:%M:%S %Z"
# CURRENT_REPO_VERSION = 17
# 
# Path: jirafs/readers.py
# class GitRevisionReader(object):
#     def __init__(self, folder, revision):
#         self.folder = folder
#         self.revision = revision
#         super(GitRevisionReader, self).__init__()
# 
#     def get_file_contents(self, path):
#         try:
#             return self.folder.get_local_file_at_revision(
#                 path, self.revision, failure_ok=False
#             )
#         except GitCommandError:
#             return ""
# 
# class WorkingCopyReader(object):
#     def __init__(self, folder, path):
#         self.folder = folder
#         self.path = path
#         super(WorkingCopyReader, self).__init__()
# 
#     def get_file_contents(self, path):
#         full_path = os.path.join(self.path, path)
# 
#         with io.open(
#             self.folder.get_local_path(full_path), "r", encoding="utf-8"
#         ) as _in:
#             return _in.read().strip()


# Path: jirafs/jirafieldmanager.py
import io
import json
import os
import re
from jirafs import constants
from jirafs.readers import GitRevisionReader, WorkingCopyReader

            return self.folder.process_macros(
                self[field_name], path=self.get_generated_file_path()
            )
        except KeyError:
            return default

    @classmethod
    def create(cls, folder, revision=None, path=None):
        if revision and path:
            raise TypeError("You may specify a git revision or a local path; not both.")

        if revision:
            return GitRevisionJiraFieldManager(folder, revision)
        else:
            return WorkingCopyJiraFieldManager(folder, path)

    def get_requested_per_ticket_fields(self):
        return constants.FILE_FIELDS

    def get_used_per_ticket_fields(self):
        raise NotImplementedError()

    def get_field_data_files(self):
        all_files = [
            constants.TICKET_DETAILS,
        ]

        try:
            for field in self.get_used_per_ticket_fields():
                all_files.append(

                    constants.TICKET_FILE_FIELD_TEMPLATE.format(