Пример #1
0
    def __init__(self, repoPath, local_site):
        from mercurial import hg, ui
        from mercurial.__version__ import version

        version = version.replace("+", ".")
        version_parts = [int(x) for x in version.split(".")]

        if version_parts[0] == 1 and version_parts[1] <= 2:
            hg_ui = ui.ui(interactive=False)
        else:
            hg_ui = ui.ui()
            hg_ui.setconfig('ui', 'interactive', 'off')

        # Check whether ssh is configured for mercurial. Assume that any
        # configured ssh is set up correctly for this repository.
        hg_ssh = hg_ui.config('ui', 'ssh')

        if not hg_ssh:
            logging.debug('Using rbssh for mercurial')
            hg_ui.setconfig('ui', 'ssh', 'rbssh --rb-local-site=%s'
                            % local_site)
        else:
            logging.debug('Found configured ssh for mercurial: %s' % hg_ssh)

        self.repo = hg.repository(hg_ui, path=repoPath)
Пример #2
0
    def __init__(self, repoPath, local_site):
        from mercurial import hg, ui
        from mercurial.__version__ import version

        version = version.replace("+", ".")
        version_parts = [int(x) for x in version.split(".")]

        if version_parts[0] == 1 and version_parts[1] <= 2:
            hg_ui = ui.ui(interactive=False)
        else:
            hg_ui = ui.ui()
            hg_ui.setconfig('ui', 'interactive', 'off')

        # Check whether ssh is configured for mercurial. Assume that any
        # configured ssh is set up correctly for this repository.
        hg_ssh = hg_ui.config('ui', 'ssh')

        if not hg_ssh:
            logging.debug('Using rbssh for mercurial')
            hg_ui.setconfig('ui', 'ssh',
                            'rbssh --rb-local-site=%s' % local_site)
        else:
            logging.debug('Found configured ssh for mercurial: %s' % hg_ssh)

        self.repo = hg.repository(hg_ui, path=repoPath)
Пример #3
0
    def __init__(self, repoPath):
        from mercurial import hg, ui
        from mercurial.__version__ import version

        version_parts = [int(x) for x in version.split(".")]

        if version_parts[0] == 1 and version_parts[1] <= 2:
            hg_ui = ui.ui(interactive=False)
        else:
            hg_ui = ui.ui()
            hg_ui.setconfig('ui', 'interactive', 'off')

        self.repo = hg.repository(hg_ui, path=repoPath)
Пример #4
0
    def __init__(self, repoPath):
        from mercurial import hg, ui
        from mercurial.__version__ import version

        version_parts = [int(x) for x in version.split(".")]

        if version_parts[0] == 1 and version_parts[1] <= 2:
            hg_ui = ui.ui(interactive=False)
        else:
            hg_ui = ui.ui()
            hg_ui.setconfig('ui', 'interactive', 'off')

        hg_ui.setconfig('ui', 'ssh', 'rbssh')

        self.repo = hg.repository(hg_ui, path=repoPath)
Пример #5
0
def lazy_load_mercurial():
    global _mercurial_loaded
    if _mercurial_loaded:
        return
    _mercurial_loaded = True
    import mercurial
    try:
        from mercurial import demandimport
        demandimport.enable = lambda: None
    except ImportError:
        pass
    from mercurial.__version__ import version as hg_version
    if hg_version != "unknown":
        hg_major_version = ".".join(hg_version.split(".")[:2])
        if hg_major_version not in hg_compatible_version_strings and not "+" in hg_version:
            raise errors.DependencyNotPresent(
                "mercurial",
                'bzr-hg: Mercurial version %s not supported.' % hg_version)
    trace.mutter("bzr-hg: using Mercurial %s" % hg_version)
Пример #6
0
    def __init__(self, repoPath, local_site):
        from mercurial import hg, ui
        from mercurial.__version__ import version

        version_parts = [int(x) for x in version.split(".")]

        if version_parts[0] == 1 and version_parts[1] <= 2:
            hg_ui = ui.ui(interactive=False)
        else:
            hg_ui = ui.ui()
            hg_ui.setconfig("ui", "interactive", "off")

        # Check whether ssh is configured for mercurial. Assume that any
        # configured ssh is set up correctly for this repository.
        hg_ssh = hg_ui.config("ui", "ssh")

        if not hg_ssh:
            logging.debug("Using rbssh for mercurial")
            hg_ui.setconfig("ui", "ssh", "rbssh --rb-local-site=%s" % local_site)
        else:
            logging.debug("Found configured ssh for mercurial: %s" % hg_ssh)

        self.repo = hg.repository(hg_ui, path=repoPath)
Пример #7
0
buglink = 'https://code.google.com/p/hgnested/issues/'

import os
import time
from functools import partial
from mercurial import hg
from mercurial import commands, localrepo, hgweb
from mercurial import util
from mercurial import cmdutil
from mercurial import wireproto
from mercurial.error import CapabilityError
from mercurial.scmutil import walkrepos
from mercurial.i18n import _
from mercurial.__version__ import version as mercurial_version

version = map(int, mercurial_version.split('-', 1)[0].split('.', 2)[:2])

if version >= [2, 3]:
    from mercurial import sshpeer, httppeer
else:
    from mercurial import sshrepo, httprepo
    sshpeer, httppeer = None, None

__version__ = '0.6'

_nested_cache = {}
_nested_refreshinterval = 20

_capabilities_parent = wireproto.capabilities