Ejemplo n.º 1
0
def register_commands():
    module = 'bzrlib.plugins.externals.commands'
    plugin_cmds.register_lazy('cmd_externals_add',
        ['eadd'], module)
    plugin_cmds.register_lazy('cmd_externals_command',
        ['ecmd'], module)
Ejemplo n.º 2
0
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

"""Print lines matching PATTERN for specified files and revisions."""

from __future__ import absolute_import

from bzrlib import version_info
from bzrlib.commands import plugin_cmds

plugin_cmds.register_lazy("cmd_grep", [], "bzrlib.plugins.grep.cmds")

def test_suite():
    from bzrlib.tests import TestUtil

    suite = TestUtil.TestSuite()
    loader = TestUtil.TestLoader()
    testmod_names = [
        'test_grep',
        ]

    suite.addTest(loader.loadTestsFromModuleNames(
            ["%s.%s" % (__name__, tmn) for tmn in testmod_names]))
    return suite

Ejemplo n.º 3
0
from info import (
    bzr_commands,
    bzr_plugin_version as version_info,
    bzr_compatible_versions,
    )

if version_info[3] == 'final':
    version_string = '%d.%d.%d' % version_info[:3]
else:
    version_string = '%d.%d.%d%s%d' % version_info
__version__ = version_string
__author__ = 'Jelmer Vernooij <*****@*****.**>'

bzrlib.api.require_any_api(bzrlib, bzr_compatible_versions)

if __name__ == 'bzrlib.plugins.rebase':
    raise ImportError("The rebase plugin has been renamed to rewrite. Please rename the directory in ~/.bazaar/plugins")

for cmd in bzr_commands:
    plugin_cmds.register_lazy("cmd_%s" % cmd, [],
        "bzrlib.plugins.rewrite.commands")


def test_suite():
    """Returns the testsuite for bzr-rewrite."""
    from unittest import TestSuite
    from bzrlib.plugins.rewrite import tests
    suite = TestSuite()
    suite.addTest(tests.test_suite())
    return suite
Ejemplo n.º 4
0
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
"""Print lines matching PATTERN for specified files and revisions."""

from __future__ import absolute_import

from bzrlib import version_info
from bzrlib.commands import plugin_cmds

plugin_cmds.register_lazy("cmd_grep", [], "bzrlib.plugins.grep.cmds")


def test_suite():
    from bzrlib.tests import TestUtil

    suite = TestUtil.TestSuite()
    loader = TestUtil.TestLoader()
    testmod_names = [
        'test_grep',
    ]

    suite.addTest(
        loader.loadTestsFromModuleNames(
            ["%s.%s" % (__name__, tmn) for tmn in testmod_names]))
    return suite
Ejemplo n.º 5
0
    aliases = ['ds']

    def run(self,
            revision=None,
            dir_only=False,
            file_list=None,
            no_color=False):
        return cmd_diff().run(file_list=file_list,
                              stat=True,
                              stat_dir=dir_only,
                              revision=revision,
                              no_color=no_color)


register_command(cmd_diffstat)
diff_class = register_command(cmd_diff, decorate=True)

try:
    from bzrlib.plugins import qbzr
except ImportError:
    qbzr = None

if qbzr is not None:
    plugin_cmds.register_lazy('cmd_qdiffstat', [],
                              'bzrlib.plugins.diffstat.qdiffstat')


def test_suite():
    import tests
    return tests.test_suite()
Ejemplo n.º 6
0
"""

from __future__ import absolute_import

from bzrlib.plugins.xmloutput import info

from bzrlib.commands import plugin_cmds

version_info = info.bzr_plugin_version
plugin_name = info.bzr_plugin_name

for cmd in [
        "xmlstatus", "xmlannotate", "xmlmissing", "xmlinfo", "xmlplugins",
        "xmlversion", "start_xmlrpc", "stop_xmlrpc", "xmllog", "xmlls"
]:
    plugin_cmds.register_lazy("cmd_%s" % cmd, [],
                              "bzrlib.plugins.xmloutput.cmds")

try:
    from bzrlib.registry import register_lazy
except ImportError:
    from bzrlib import (
        log, )
    log.log_formatter_registry.register_lazy(
        'xml', "bzrlib.plugins.xmloutput.logxml", "XMLLogFormatter",
        'Detailed XML log format')
else:
    register_lazy("bzrlib.log", "log_formatter_registry", 'xml',
                  "bzrlib.plugins.xmloutput.logxml", "XMLLogFormatter",
                  'Detailed XML log format')

Ejemplo n.º 7
0
    # Since we are a built-in plugin we share the bzrlib version
    trace,
    version_info,
)
from bzrlib.commands import (
    plugin_cmds, )
from bzrlib.directory_service import directories
from bzrlib.help_topics import topic_registry

for klsname, aliases in [("cmd_register_branch", []),
                         ("cmd_launchpad_open", ["lp-open"]),
                         ("cmd_launchpad_login", ["lp-login"]),
                         ("cmd_launchpad_mirror", ["lp-mirror"]),
                         ("cmd_lp_propose_merge", ["lp-submit", "lp-propose"]),
                         ("cmd_lp_find_proposal", [])]:
    plugin_cmds.register_lazy(klsname, aliases,
                              "bzrlib.plugins.launchpad.cmds")


def _register_directory():
    directories.register_lazy(
        'lp:',
        'bzrlib.plugins.launchpad.lp_directory',
        'LaunchpadDirectory',
        'Launchpad-based directory service',
    )
    directories.register_lazy('debianlp:',
                              'bzrlib.plugins.launchpad.lp_directory',
                              'LaunchpadDirectory', 'debianlp: shortcut')
    directories.register_lazy('ubuntu:',
                              'bzrlib.plugins.launchpad.lp_directory',
                              'LaunchpadDirectory', 'ubuntu: shortcut')
Ejemplo n.º 8
0
version_info = info.bzr_plugin_version
plugin_name = info.bzr_plugin_name

for cmd in [
    "xmlstatus",
    "xmlannotate",
    "xmlmissing",
    "xmlinfo",
    "xmlplugins",
    "xmlversion",
    "start_xmlrpc",
    "stop_xmlrpc",
    "xmllog",
    "xmlls"]:
    plugin_cmds.register_lazy(
        "cmd_%s" % cmd, [],
        "bzrlib.plugins.xmloutput.cmds")


try:
    from bzrlib.registry import register_lazy
except ImportError:
    from bzrlib import (
        log,
        )
    log.log_formatter_registry.register_lazy('xml',
        "bzrlib.plugins.xmloutput.logxml", "XMLLogFormatter",
        'Detailed XML log format')
else:
    register_lazy("bzrlib.log", "log_formatter_registry", 'xml',
        "bzrlib.plugins.xmloutput.logxml", "XMLLogFormatter",
Ejemplo n.º 9
0
    "gpush": [],
    "gsend": [],
    "gstatus": ["gst"],
    "gtags": [],
    "visualise": ["visualize", "vis", "viz", 'glog'],
    }

try:
    from bzrlib.plugins import loom
except ImportError:
    pass # Loom plugin doesn't appear to be present
else:
    commands["gloom"] = []

for cmd, aliases in commands.iteritems():
    plugin_cmds.register_lazy("cmd_%s" % cmd, aliases,
                              "bzrlib.plugins.gtk.commands")

def save_commit_messages(*args):
    from bzrlib.plugins.gtk import commit
    commit.save_commit_messages(*args)

branch.Branch.hooks.install_named_hook('post_uncommit',
                                       save_commit_messages,
                                       "Saving commit messages for gcommit")

credential_store_registry = getattr(config, "credential_store_registry", None)
if credential_store_registry is not None:
    try:
        credential_store_registry.register_lazy(
            "gnome-keyring", "bzrlib.plugins.gtk.keyring", "GnomeKeyringCredentialStore",
            help="The GNOME Keyring.", fallback=True)
Ejemplo n.º 10
0
from bzrlib.plugins.fastimport.info import (
    bzr_plugin_version as version_info,
    )

from bzrlib.commands import plugin_cmds


def load_fastimport():
    """Load the fastimport module or raise an appropriate exception."""
    try:
        import fastimport
    except ImportError, e:
        from bzrlib.errors import DependencyNotPresent
        raise DependencyNotPresent("fastimport",
            "bzr-fastimport requires the fastimport python module")


def test_suite():
    from bzrlib.plugins.fastimport import tests
    return tests.test_suite()


for name in [
        "fast_import",
        "fast_import_filter",
        "fast_import_info",
        "fast_import_query",
        "fast_export",
        ]:
    plugin_cmds.register_lazy("cmd_%s" % name, [], "bzrlib.plugins.fastimport.cmds")
Ejemplo n.º 11
0
from bzrlib.commands import plugin_cmds

plugin_cmds.register_lazy('cmd_wikkid', ['wiki'],
                          'bzrlib.plugins.wikkid.commands')
Ejemplo n.º 12
0
# -*- coding: UTF-8 -*-
# Copyright (C) 2008 Erik Bågfors <*****@*****.**>
#
# GNU GPL v2.
#
"""external merge plugin for bzr"""

try:
    from bzrlib.commands import plugin_cmds
    plugin_cmds.register_lazy('cmd_extmerge', ['emerge'],
                              'bzrlib.plugins.extmerge.extmerge')
except AttributeError:
    from bzrlib.commands import register_command
    from extmerge import cmd_extmerge
    register_command(cmd_extmerge)
Ejemplo n.º 13
0
    ('bzrlib.plugins.qbzr.lib.commands', 'cmd_qverify_signatures', []),
    ('bzrlib.plugins.qbzr.lib.commands', 'cmd_qversion', ['qsysinfo']),
    ('bzrlib.plugins.qbzr.lib.commands', 'cmd_qviewer', []),
    ('bzrlib.plugins.qbzr.lib.commands', 'cmd_qsend', ['qsend']),
    ('bzrlib.plugins.qbzr.lib.commands', 'cmd_qswitch', []),
    ('bzrlib.plugins.qbzr.lib.commands', 'cmd_qunbind', []),
    # extra commands
    ('bzrlib.plugins.qbzr.lib.extra.bugurl', 'cmd_bug_url', []),
    ('bzrlib.plugins.qbzr.lib.extra.isignored', 'cmd_is_ignored', []),
    ('bzrlib.plugins.qbzr.lib.extra.isversioned', 'cmd_is_versioned', []),
    # hidden power of qbzr ;-)
    ('bzrlib.plugins.qbzr.lib.commands', 'cmd_qsubprocess', []),
)

for module, name, aliases in lazy_commands:
    plugin_cmds.register_lazy(name, aliases, module)


def post_uncommit_hook(local, master, old_revno, old_tip, new_revno, hook_new_tip):
    from bzrlib.plugins.qbzr.lib.commit_data import QBzrCommitData
    branch = local or master
    ci_data = QBzrCommitData(branch=branch)
    ci_data.set_data_on_uncommit(old_tip, hook_new_tip)
    ci_data.save()


try:
    from bzrlib.hooks import install_lazy_named_hook
except ImportError:
    from bzrlib.branch import Branch
    Branch.hooks.install_named_hook('post_uncommit', post_uncommit_hook,
Ejemplo n.º 14
0
    version_info,
    )
from bzrlib.commands import (
    plugin_cmds,
    )
from bzrlib.directory_service import directories
from bzrlib.help_topics import topic_registry

for klsname, aliases in [
    ("cmd_register_branch", []),
    ("cmd_launchpad_open", ["lp-open"]),
    ("cmd_launchpad_login", ["lp-login"]),
    ("cmd_launchpad_mirror", ["lp-mirror"]),
    ("cmd_lp_propose_merge", ["lp-submit", "lp-propose"]),
    ("cmd_lp_find_proposal", [])]:
    plugin_cmds.register_lazy(klsname, aliases,
        "bzrlib.plugins.launchpad.cmds")


def _register_directory():
    directories.register_lazy('lp:', 'bzrlib.plugins.launchpad.lp_directory',
                              'LaunchpadDirectory',
                              'Launchpad-based directory service',)
    directories.register_lazy(
        'debianlp:', 'bzrlib.plugins.launchpad.lp_directory',
        'LaunchpadDirectory',
        'debianlp: shortcut')
    directories.register_lazy(
        'ubuntu:', 'bzrlib.plugins.launchpad.lp_directory',
        'LaunchpadDirectory',
        'ubuntu: shortcut')
Ejemplo n.º 15
0
# -*- coding: UTF-8 -*-
# Copyright (C) 2008 Erik Bågfors <*****@*****.**>
#
# GNU GPL v2.
#
"""external merge plugin for bzr"""

try:
    from bzrlib.commands import plugin_cmds
    plugin_cmds.register_lazy('cmd_extmerge', ['emerge'],
                          'bzrlib.plugins.extmerge.extmerge')
except AttributeError:
    from bzrlib.commands import register_command
    from extmerge import cmd_extmerge
    register_command(cmd_extmerge)
Ejemplo n.º 16
0
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

"""Support for git-style bisection."""

from bzrlib.commands import plugin_cmds

from meta import *

plugin_cmds.register_lazy('cmd_bisect', [], 'bzrlib.plugins.bisect.cmds')

def load_tests(basic_tests, module, loader):
    testmod_names = [
        'tests',
        ]
    basic_tests.addTest(loader.loadTestsFromModuleNames(
            ["%s.%s" % (__name__, tmn) for tmn in testmod_names]))
    return basic_tests