import time import fnmatch import logging import json from flask import Flask, Response, request, redirect, jsonify, render_template, make_response from repository import Repository, MercurialException, UnknownRevisionException logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) PROJECT_DIR = os.path.dirname(os.path.realpath(__file__)) TRANSPLANT_FILTER = os.path.join(PROJECT_DIR, 'transplant_filter.py') PULL_INTERVAL = 60 MAX_COMMITS = 100 Repository.register_extension('collapse', os.path.join(PROJECT_DIR, 'vendor', 'hgext', 'collapse.py')) app = Flask(__name__, static_folder='../client/build', static_url_path='') app.config.from_object('config') # make sure that WORKDIR exists if not os.path.exists(app.config['WORKDIR']): os.makedirs(app.config['WORKDIR']) def is_allowed_transplant(src, dst): return src != dst def find_repo(name): for repository in app.config['REPOSITORIES']: