Example #1
0
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
"""Merge logic for po_merge plugin."""

from ... import (
    config,
    merge,
)

from breezy.lazy_import import lazy_import
lazy_import(
    globals(), """
import fnmatch
import subprocess
import tempfile

from breezy import (
    cmdline,
    osutils,
    trace,
    )
""")

command_option = config.Option(
    'po_merge.command',
    default='msgmerge -N "{other}" "{pot_file}" -C "{this}" -o "{result}"',
    help='''\
Command used to create a conflict-free .po file during merge.

The following parameters are provided by the hook:
``this`` is the ``.po`` file content before the merge in the current branch,
``other`` is the ``.po`` file content in the branch merged from,
Example #2
0
File: gpg.py Project: tpow/breezy
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

"""GPG signing and checking logic."""

from __future__ import absolute_import

import os

from breezy.lazy_import import lazy_import
lazy_import(globals(), """
from breezy import (
    config,
    trace,
    ui,
    )
from breezy.i18n import (
    gettext,
    ngettext,
    )
""")

from . import (
    errors,
    )
from .sixish import (
    text_type,
    )

# verification results
SIGNATURE_VALID = 0
Example #3
0
from breezy.lazy_import import lazy_import

QStringList = list

lazy_import(
    globals(), '''
import re

from breezy import errors
from breezy import osutils
from breezy.controldir import ControlDir
from breezy.urlutils import determine_relative_path, join, split

from breezy.plugins.qbrz.lib.logwidget import LogList
from breezy.plugins.qbrz.lib import logmodel
from breezy.plugins.qbrz.lib.loggraphviz import BranchInfo

from breezy.plugins.qbrz.lib.diff import (
    has_ext_diff,
    ExtDiffMenu,
    DiffButtons,
    )
from breezy.plugins.qbrz.lib.i18n import gettext
from breezy.plugins.qbrz.lib.revisionmessagebrowser import LogListRevisionMessageBrowser
from breezy.plugins.qbrz.lib.cat import QBzrCatWindow
from breezy.plugins.qbrz.lib.annotate import AnnotateWindow
''')

PathRole = QtCore.Qt.UserRole + 1
file_idRole = QtCore.Qt.UserRole + 2
AliveRole = QtCore.Qt.UserRole + 3
Example #4
0
from breezy.plugins.qbrz.lib.widgets.texteditaccessory import (
    GuideBar, setup_guidebar_for_find)
from breezy.plugins.qbrz.lib.decorators import lazy_call
from breezy import errors
from breezy.plugins.qbrz.lib.uifactory import ui_current_widget
from breezy.plugins.qbrz.lib.trace import reports_exception
from breezy.patches import HunkLine, ContextLine, InsertLine, RemoveLine
from breezy.lazy_import import lazy_import

lazy_import(
    globals(), '''
from breezy import transform, textfile, patches
from breezy.workingtree import WorkingTree
from breezy.plugins.qbrz.lib.encoding_selector import EncodingMenuSelector
from breezy.plugins.qbrz.lib.commit import TextEdit
from breezy.plugins.qbrz.lib.spellcheck import SpellCheckHighlighter, SpellChecker
from breezy.plugins.qbrz.lib.autocomplete import get_wordlist_builder
from breezy.shelf import ShelfCreator
from breezy.shelf_ui import Shelver
from breezy.osutils import split_lines
from cStringIO import StringIO
import os
''')
"""
TODO::
  Wordwrap mode
  Side by side view
  External diff (ShelveListWindow)
  Select hunk by Find.
"""

# For i18n
Example #5
0
from breezy.plugins.qbrz.lib.i18n import gettext, N_

# pyflakes says this is not needed, but it is.
import breezy.plugins.qbrz.lib.resources

from breezy import errors

from breezy.lazy_import import lazy_import
from functools import reduce
lazy_import(
    globals(), '''
from breezy import (
    osutils,
    urlutils,
    ui,
)
from breezy.plugins.qbrz.lib import trace
from breezy.workingtree import WorkingTree
from breezy.transport import get_transport
from breezy.lockdir import LockDir

from breezy.plugins.qbrz.lib.compatibility import configobj
''')

# standard buttons with translatable labels
BTN_OK, BTN_CANCEL, BTN_CLOSE, BTN_HELP, BTN_REFRESH = list(range(5))


class StandardButton(QtWidgets.QPushButton):

    __types = {
        BTN_OK: (N_('&OK'), 'SP_DialogOkButton'),
Example #6
0
from breezy.plugins.qbrz.lib.diffview import (
    SidebySideDiffView,
    SimpleDiffView,
    )

from breezy.plugins.qbrz.lib.uifactory import ui_current_widget
from breezy.plugins.qbrz.lib.trace import reports_exception
from breezy.plugins.qbrz.lib.logwidget import LogList
from breezy.plugins.qbrz.lib.decorators import lazy_call
from breezy.plugins.qbrz.lib.widgets.texteditaccessory import setup_guidebar_for_find
from breezy.lazy_import import lazy_import
lazy_import(globals(), '''
from breezy import transform
from breezy.workingtree import WorkingTree
from breezy.plugins.qbrz.lib.encoding_selector import EncodingMenuSelector
from breezy.plugins.qbrz.lib.diff import DiffItem
from breezy.shelf import Unshelver
from breezy.shelf_ui import Unshelver as Unshelver_ui
from breezy.plugins.qbrz.lib.subprocess import SimpleSubProcessDialog
import sip
''')


class ShelveListWidget(ToolbarPanel):
    documentChangeFinished = QtCore.pyqtSignal()
    unshelved = QtCore.pyqtSignal(int, 'QString')

    def __init__(self, directory=None, complete=False, ignore_whitespace=False,
                 encoding=None, splitters=None, parent=None):
        ToolbarPanel.__init__(self, slender=False, icon_size=22, parent=parent)

        self.initial_encoding = encoding
Example #7
0
    QBzrWindow,
    ThrobberWidget,
    runs_in_loading_queue,
    url_for_display,
)
from breezy.plugins.qbrz.lib.uifactory import ui_current_widget
from breezy.plugins.qbrz.lib.trace import reports_exception

from breezy.lazy_import import lazy_import
lazy_import(
    globals(), '''
from breezy import (
    osutils,
    errors,
    )
from breezy.controldir import ControlDir
from breezy.revisionspec import RevisionSpec

from breezy.plugins.qbrz.lib.i18n import gettext
from breezy.plugins.qbrz.lib.treewidget import TreeWidget, TreeFilterMenu
from breezy.plugins.qbrz.lib.diff import DiffButtons
''')


class BrowseWindow(QBzrWindow):
    def __init__(self,
                 branch=None,
                 location=None,
                 revision=None,
                 revision_id=None,
                 revision_spec=None,
Example #8
0
)

from breezy.lazy_import import lazy_import
try:
    QString = unicode
except NameError:
    # Python 3
    QString = str

lazy_import(
    globals(), '''
import errno
import re
import time
import sys
import os
import glob
from patiencediff import PatienceSequenceMatcher as SequenceMatcher
from breezy.plugins.qbrz.lib.i18n import gettext, ngettext, N_
from breezy import trace, osutils, cmdline
from breezy.workingtree import WorkingTree
from breezy.trace import mutter
''')
from breezy.diff import DiffFromTool, DiffPath
subprocess = __import__('subprocess', {}, {}, [])

qconfig = get_qbrz_config()
default_diff = qconfig.get_option("default_diff")
if default_diff is None:
    default_diff = ""
ext_diffs = {gettext("Builtin Diff"): ""}
for name, command in list(qconfig.get_section('EXTDIFF').items()):
Example #9
0
from breezy.plugins.qbrz.lib.trace import reports_exception

from breezy.lazy_import import lazy_import

lazy_import(
    globals(), '''

from breezy import errors
from breezy.plugins.qbrz.lib.spellcheck import SpellCheckHighlighter, SpellChecker
from breezy.plugins.qbrz.lib.autocomplete import get_wordlist_builder
from breezy.plugins.qbrz.lib.commit_data import QBzrCommitData
from breezy.plugins.qbrz.lib.diff import (
    DiffButtons,
    show_diff,
    InternalWTDiffArgProvider,
    )
from breezy.plugins.qbrz.lib.i18n import gettext
from breezy.plugins.qbrz.lib import logmodel
from breezy.plugins.qbrz.lib.loggraphviz import BranchInfo
from breezy.plugins.qbrz.lib.treewidget import (
    TreeWidget,
    SelectAllCheckBox,
    )
from breezy.plugins.qbrz.lib.revisionview import RevisionView
from breezy.plugins.qbrz.lib.update import QBzrUpdateWindow

''')
MAX_AUTOCOMPLETE_FILES = 20


class TextEdit(QtWidgets.QTextEdit):
Example #10
0
lazy_import(
    globals(), '''
import sys

from PyQt5 import QtCore, QtGui, QtWidgets

from breezy import (
    builtins,
    osutils,
    ui,
    gpg,
    )
from breezy.branch import Branch
from breezy.controldir import ControlDir
from breezy.workingtree import WorkingTree
from breezy.diff import get_trees_and_branches_to_diff_locked

from breezy.plugins.qbrz.lib import i18n
from breezy.plugins.qbrz.lib.add import AddWindow
from breezy.plugins.qbrz.lib.annotate import AnnotateWindow
from breezy.plugins.qbrz.lib.branch import QBzrBranchWindow
from breezy.plugins.qbrz.lib.browse import BrowseWindow
from breezy.plugins.qbrz.lib.cat import (
    QBzrCatWindow,
    QBzrViewWindow,
    cat_to_native_app,
    )
from breezy.plugins.qbrz.lib.commit import CommitWindow
from breezy.plugins.qbrz.lib.config import QBzrConfigWindow
from breezy.plugins.qbrz.lib.diffwindow import DiffWindow
from breezy.plugins.qbrz.lib.getupdates import UpdateBranchWindow, UpdateCheckoutWindow
from breezy.plugins.qbrz.lib.help import show_help
from breezy.plugins.qbrz.lib.log import LogWindow
from breezy.plugins.qbrz.lib.info import QBzrInfoWindow
from breezy.plugins.qbrz.lib.init import QBzrInitWindow
from breezy.plugins.qbrz.lib.main import QBzrMainWindow
from breezy.plugins.qbrz.lib.verify_signatures import \
QBzrVerifySignaturesWindow
from breezy.plugins.qbrz.lib.pull import (
    QBzrPullWindow,
    QBzrPushWindow,
    QBzrMergeWindow,
    )
from breezy.plugins.qbrz.lib.revert import RevertWindow
from breezy.plugins.qbrz.lib.tag import TagWindow
from breezy.plugins.qbrz.lib.tree_branch import TreeBranch
from breezy.plugins.qbrz.lib.uncommit import QBzrUncommitWindow
from breezy.plugins.qbrz.lib.update import QBzrUpdateWindow
from breezy.plugins.qbrz.lib.util import (
    FilterOptions,
    is_valid_encoding,
    open_tree,
    )
from breezy.plugins.qbrz.lib.uifactory import QUIFactory
from breezy.plugins.qbrz.lib.send import SendWindow
from breezy.plugins.qbrz.lib.shelvewindow import ShelveWindow
from breezy.plugins.qbrz.lib.widgets.shelvelist import ShelveListWindow
''')
Example #11
0
    get_monospace_font,
    StandardButton,
    get_tab_width_pixels,
)

from breezy.plugins.qbrz.lib.uifactory import ui_current_widget
from breezy.plugins.qbrz.lib.trace import reports_exception
from breezy.plugins.qbrz.lib.logwidget import LogList
from breezy.lazy_import import lazy_import
lazy_import(
    globals(), '''
from breezy import transform
from breezy.workingtree import WorkingTree
from breezy.revisiontree import RevisionTree
from breezy.plugins.qbrz.lib.encoding_selector import EncodingMenuSelector
from breezy.plugins.qbrz.lib.widgets.shelve import ShelveWidget
from breezy.plugins.qbrz.lib.widgets.shelvelist import ShelveListWidget
from breezy.plugins.qbrz.lib.widgets.splitters import Splitters
from patiencediff import PatienceSequenceMatcher as SequenceMatcher
from breezy.shelf import Unshelver
from breezy.shelf_ui import Unshelver as Unshelver_ui
''')


class ShelveWindow(QBzrWindow):
    def __init__(self,
                 initial_tab=0,
                 directory=None,
                 file_list=None,
                 complete=False,
                 ignore_whitespace=False,
Example #12
0
from breezy.plugins.qbrz.lib.revtreeview import (RevisionTreeView,
                                                 RevNoItemDelegate,
                                                 get_text_color)
from breezy.revision import NULL_REVISION, CURRENT_REVISION
from breezy.plugins.qbrz.lib.util import (
    runs_in_loading_queue, )
from breezy.plugins.qbrz.lib.trace import reports_exception, SUB_LOAD_METHOD
from breezy.plugins.qbrz.lib.uifactory import ui_current_widget

from breezy.lazy_import import lazy_import
lazy_import(
    globals(), '''
from breezy.controldir import ControlDir
from breezy.revisionspec import RevisionSpec
from breezy.plugins.qbrz.lib.tag import TagWindow, CallBackTagWindow
from breezy.plugins.qbrz.lib import logmodel
from breezy.plugins.qbrz.lib import diff
from breezy.plugins.qbrz.lib.i18n import gettext
from breezy.plugins.qbrz.lib.subprocess import SimpleSubProcessDialog
''')


class LogList(RevisionTreeView):
    """TreeView widget to show log with metadata and graph of revisions."""
    def __init__(self,
                 processEvents,
                 throbber,
                 parent=None,
                 view_commands=True,
                 action_commands=False):
        """Costructing new widget.
Example #13
0
)
from breezy.plugins.qbrz.lib.uifactory import ui_current_widget
from breezy.plugins.qbrz.lib.trace import reports_exception
from breezy.plugins.qbrz.lib.logwidget import LogList
from breezy.plugins.qbrz.lib.lazycachedrevloader import (load_revisions,
                                                         cached_revisions)
from breezy.plugins.qbrz.lib.texteditannotate import (AnnotateBarBase,
                                                      AnnotateEditerFrameBase)
from breezy.lazy_import import lazy_import
lazy_import(globals(), '''
from breezy.config import parse_username
from breezy.workingtree import WorkingTree
from breezy.revisiontree import RevisionTree
from breezy.plugins.qbrz.lib.revisionmessagebrowser import LogListRevisionMessageBrowser
from breezy.plugins.qbrz.lib.encoding_selector import EncodingMenuSelector
from breezy.plugins.qbrz.lib.widgets.tab_width_selector import TabWidthMenuSelector
from breezy.plugins.qbrz.lib.syntaxhighlighter import highlight_document
from breezy.plugins.qbrz.lib.revtreeview import paint_revno, get_text_color
from breezy.plugins.qbrz.lib import logmodel
from breezy.plugins.qbrz.lib.loggraphviz import BranchInfo
from patiencediff import PatienceSequenceMatcher as SequenceMatcher
''')


class AnnotateBar(AnnotateBarBase):

    def __init__(self, edit, parent, get_revno):
        super(AnnotateBar, self).__init__(edit, parent)

        self.get_revno = get_revno
        self.annotate = None
Example #14
0
"""Loom commands."""

from __future__ import absolute_import

from breezy import controldir, directory_service, workingtree
import breezy.commands
import breezy.branch
from breezy import errors
from breezy.lazy_import import lazy_import
from breezy.option import Option
import breezy.trace
import breezy.transport

lazy_import(
    globals(), """
from breezy.plugins.loom import branch
from breezy.plugins.loom.tree import LoomTreeDecorator
""")


class cmd_loomify(breezy.commands.Command):
    """Add a loom to this branch.

    This creates a loom in your branch, which will alter the behaviour of
    bzr for a number of commands to manage a group of patches being evolved
    in parallel.

    You must have a branch nickname explicitly set to use this command, as the
    branch nickname becomes the 'base thread' of the loom.  You can specify
    the branch nick with the --base option.
    """
Example #15
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

from PyQt5 import QtCore, QtGui, QtWidgets
from breezy.plugins.qbrz.lib import MS_WINDOWS

from breezy.lazy_import import lazy_import
lazy_import(
    globals(), '''
from breezy.plugins.qbrz.lib.util import run_in_loading_queue
from breezy.plugins.qbrz.lib.lazycachedrevloader import load_revisions
from breezy.plugins.qbrz.lib.diff import ExtDiffContext
from breezy.transport.local import LocalTransport
''')

RevIdRole = QtCore.Qt.UserRole + 1


class RevisionTreeView(QtWidgets.QTreeView):
    """TreeView widget to shows revisions.

    Only revisions that are visible on screen are loaded.

    The model for this tree view must have the following methods:
    def on_revisions_loaded(self, revisions, last_call)
    def get_revid(self, index)