Example #1
0
    def __init__(self, path, revision=None):
        InterfaceView.__init__(self, "branch", "Branch")

        self.vcs = rabbitvcs.vcs.VCS()
        self.svn = self.vcs.svn()

        self.path = path
        self.revision = revision

        status = self.vcs.status(self.path)

        repo_paths = helper.get_repository_paths()
        self.from_urls = rabbitvcs.ui.widget.ComboBox(
            self.get_widget("from_urls"), repo_paths)
        self.to_urls = rabbitvcs.ui.widget.ComboBox(
            self.get_widget("to_urls"), helper.get_repository_paths())

        repository_url = self.svn.get_repo_url(path)
        self.from_urls.set_child_text(repository_url)
        self.to_urls.set_child_text(repository_url)

        self.message = rabbitvcs.ui.widget.TextView(self.get_widget("message"))
        self.get_widget("toggle_switch_after_branch").set_active(
            self.SWITCH_AFTER)

        self.revision_selector = rabbitvcs.ui.widget.RevisionSelector(
            self.get_widget("revision_container"),
            self.svn,
            revision=revision,
            url_combobox=self.from_urls,
            expand=True)

        if (self.revision is None and status.has_modified()):
            self.revision_selector.set_kind_working()
Example #2
0
    def __init__(self, path, revision_range=None):
        InterfaceView.__init__(self, "merge", "Merge")

        self.revision_range = revision_range

        self.assistant = self.get_widget("Merge")

        self.path = path

        self.page = self.assistant.get_nth_page(0)
        self.last_page = None

        self.vcs = rabbitvcs.vcs.VCS()
        self.svn = self.vcs.svn()

        if not self.svn.has_merge2():
            self.get_widget("mergetype_range_opt").set_sensitive(False)
            self.get_widget("mergetype_tree_opt").set_active(True)
            self.get_widget("mergetype_reintegrate_opt").set_active(False)
            self.get_widget("mergeoptions_only_record").set_active(False)

        if not self.svn.has_merge_reintegrate():
            self.get_widget("mergetype_reintegrate_opt").set_sensitive(False)

        self.assistant.set_page_complete(self.page, True)
        self.assistant.set_forward_page_func(self.on_forward_clicked)

        self.repo_paths = helper.get_repository_paths()

        # Keeps track of which stages should be marked as complete
        self.type = None

        self.initialize_root_url()
Example #3
0
    def __init__(self, path1=None, revision1=None, path2=None, revision2=None):
        InterfaceView.__init__(self, "changes", "Changes")

        self.vcs = rabbitvcs.vcs.VCS()

        self.MORE_ACTIONS_CALLBACKS = [
            None,
            self.on_more_actions_view_unified_diff
        ]

        self.more_actions = rabbitvcs.ui.widget.ComboBox(
            self.get_widget("more_actions"),
            self.MORE_ACTIONS_ITEMS
        )
        self.more_actions.set_active(0)

        repo_paths = helper.get_repository_paths()
        self.first_urls = rabbitvcs.ui.widget.ComboBox(
            self.get_widget("first_urls"),
            repo_paths
        )
        self.first_urls_browse = self.get_widget("first_urls_browse")

        self.second_urls = rabbitvcs.ui.widget.ComboBox(
            self.get_widget("second_urls"),
            repo_paths
        )
        self.second_urls_browse = self.get_widget("second_urls_browse")
Example #4
0
    def __init__(self, path, revision_range = None):
        InterfaceView.__init__(self, "merge", "Merge")

        self.revision_range = revision_range

        self.assistant = self.get_widget("Merge")

        self.path = path

        self.page = self.assistant.get_nth_page(0)
        self.last_page = None

        self.vcs = rabbitvcs.vcs.VCS()
        self.svn = self.vcs.svn()

        if not self.svn.has_merge2():
            self.get_widget("mergetype_range_opt").set_sensitive(False)
            self.get_widget("mergetype_tree_opt").set_active(True)
            self.get_widget("mergetype_reintegrate_opt").set_active(False)
            self.get_widget("mergeoptions_only_record").set_active(False)

        if not self.svn.has_merge_reintegrate():
            self.get_widget("mergetype_reintegrate_opt").set_sensitive(False)

        self.assistant.set_page_complete(self.page, True)
        self.assistant.set_forward_page_func(self.on_forward_clicked)

        self.repo_paths = helper.get_repository_paths()

        # Keeps track of which stages should be marked as complete
        self.type = None

        self.initialize_root_url()
Example #5
0
    def __init__(self, path=None, url=None, revision=None):
        InterfaceView.__init__(self, "checkout", "Checkout")

        self.path = path
        self.vcs = rabbitvcs.vcs.VCS()

        self.repositories = rabbitvcs.ui.widget.ComboBox(
            self.get_widget("repositories"),
            helper.get_repository_paths()
        )

        # We must set a signal handler for the Gtk.Entry inside the combobox
        # Because glade will not retain that information
        self.repositories.set_child_signal(
            "key-release-event",
            self.on_repositories_key_released
        )

        self.destination = helper.get_user_path()
        if path is not None:
            self.destination = path
            self.get_widget("destination").set_text(path)

        if url is not None:
            self.repositories.set_child_text(url)

        self.complete = False
    def __init__(self, path=None, url=None, revision=None):
        InterfaceView.__init__(self, "checkout", "Checkout")

        self.path = path
        self.vcs = rabbitvcs.vcs.VCS()

        self.repositories = rabbitvcs.ui.widget.ComboBox(
            self.get_widget("repositories"),
            helper.get_repository_paths()
        )

        # We must set a signal handler for the Gtk.Entry inside the combobox
        # Because glade will not retain that information
        self.repositories.set_child_signal(
            "key-release-event",
            self.on_repositories_key_released
        )

        self.destination = helper.get_user_path()
        if path is not None:
            self.destination = path
            self.get_widget("destination").set_text(S(path).display())

        if url is not None:
            self.repositories.set_child_text(url)

        self.complete = False
    def __init__(self, path):
        """
        @type   path: string
        @param  path: A path to a local working copy

        """

        InterfaceView.__init__(self, "relocate", "Relocate")

        self.path = path
        self.vcs = rabbitvcs.vcs.VCS()
        self.svn = self.vcs.svn()

        repo = S(self.svn.get_repo_url(self.path)).display()
        self.get_widget("from_url").set_text(repo)
        self.get_widget("to_url").set_text(repo)

        self.repositories = rabbitvcs.ui.widget.ComboBox(
            self.get_widget("to_urls"), helper.get_repository_paths())
Example #8
0
    def __init__(self, path, revision=None):
        InterfaceView.__init__(self, "switch", "Switch")

        self.path = path
        self.vcs = rabbitvcs.vcs.VCS()
        self.svn = self.vcs.svn()

        self.get_widget("path").set_text(S(self.path).display())
        self.repositories = rabbitvcs.ui.widget.ComboBox(
            self.get_widget("repositories"), helper.get_repository_paths())

        self.revision_selector = rabbitvcs.ui.widget.RevisionSelector(
            self.get_widget("revision_container"),
            self.svn,
            revision=revision,
            url_combobox=self.repositories,
            expand=True)

        self.repositories.set_child_text(
            helper.unquote_url(self.svn.get_repo_url(self.path)))
    def __init__(self, path):
        InterfaceView.__init__(self, "import", "Import")

        self.get_widget("Import").set_title(_("Import - %s") % path)

        self.path = path
        self.vcs = rabbitvcs.vcs.VCS()
        self.svn = self.vcs.svn()

        if self.svn.is_in_a_or_a_working_copy(path):
            self.get_widget("repository").set_text(S(self.svn.get_repo_url(path)).display())

        self.repositories = rabbitvcs.ui.widget.ComboBox(
            self.get_widget("repositories"),
            helper.get_repository_paths()
        )

        self.message = rabbitvcs.ui.widget.TextView(
            self.get_widget("message")
        )
Example #10
0
    def __init__(self, path1=None, revision1=None, path2=None, revision2=None):
        InterfaceView.__init__(self, "changes", "Changes")

        self.vcs = rabbitvcs.vcs.VCS()

        self.MORE_ACTIONS_CALLBACKS = [
            None, self.on_more_actions_view_unified_diff
        ]

        self.more_actions = rabbitvcs.ui.widget.ComboBox(
            self.get_widget("more_actions"), self.MORE_ACTIONS_ITEMS)
        self.more_actions.set_active(0)

        repo_paths = helper.get_repository_paths()
        self.first_urls = rabbitvcs.ui.widget.ComboBox(
            self.get_widget("first_urls"), repo_paths)
        self.first_urls_browse = self.get_widget("first_urls_browse")

        self.second_urls = rabbitvcs.ui.widget.ComboBox(
            self.get_widget("second_urls"), repo_paths)
        self.second_urls_browse = self.get_widget("second_urls_browse")
Example #11
0
    def __init__(self, url):
        InterfaceView.__init__(self, "browser", "Browser")

        self.vcs = rabbitvcs.vcs.VCS()
        self.svn = self.vcs.svn()

        self.url = ""
        if self.svn.is_in_a_or_a_working_copy(url):
            action = rabbitvcs.ui.action.SVNAction(self.svn,
                                                   notification=False,
                                                   run_in_thread=False)
            self.url = action.run_single(self.svn.get_repo_url, url)
        elif self.svn.is_path_repository_url(url):
            self.url = url

        self.urls = rabbitvcs.ui.widget.ComboBox(self.get_widget("urls"),
                                                 helper.get_repository_paths())
        if self.url:
            self.urls.set_child_text(helper.unquote_url(self.url))

        # We must set a signal handler for the Gtk.Entry inside the combobox
        # Because glade will not retain that information
        self.urls.set_child_signal("key-release-event",
                                   self.on_urls_key_released)

        self.revision_selector = rabbitvcs.ui.widget.RevisionSelector(
            self.get_widget("revision_container"),
            self.svn,
            url_combobox=self.urls,
            expand=True)

        self.items = []
        self.list_table = rabbitvcs.ui.widget.Table(
            self.get_widget("list"), [
                rabbitvcs.ui.widget.TYPE_PATH, GObject.TYPE_INT,
                GObject.TYPE_INT, GObject.TYPE_STRING, GObject.TYPE_FLOAT
            ], [_("Path"),
                _("Revision"),
                _("Size"),
                _("Author"),
                _("Date")],
            filters=[{
                "callback": self.file_filter,
                "user_data": {
                    "column": 0
                }
            }, {
                "callback": self.revision_filter,
                "user_data": {
                    "column": 1
                }
            }, {
                "callback": self.size_filter,
                "user_data": {
                    "column": 2
                }
            }, {
                "callback": self.date_filter,
                "user_data": {
                    "column": 4
                }
            }],
            filter_types=[
                GObject.TYPE_STRING, GObject.TYPE_STRING, GObject.TYPE_STRING,
                GObject.TYPE_STRING, GObject.TYPE_STRING
            ],
            callbacks={
                "file-column-callback": self.file_column_callback,
                "row-activated": self.on_row_activated,
                "mouse-event": self.on_list_table_mouse_event
            },
            flags={"sortable": True})

        self.url_clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
        self.repo_root_url = None

        if self.url:
            helper.save_repository_path(url)
            self.load()
Example #12
0
    def __init__(self, url):
        InterfaceView.__init__(self, "browser", "Browser")

        self.vcs = rabbitvcs.vcs.VCS()
        self.svn = self.vcs.svn()

        self.url = ""
        if self.svn.is_in_a_or_a_working_copy(url):
            action = rabbitvcs.ui.action.SVNAction(self.svn, notification=False, run_in_thread=False)
            self.url = action.run_single(self.svn.get_repo_url, url)
        elif self.svn.is_path_repository_url(url):
            self.url = url

        self.urls = rabbitvcs.ui.widget.ComboBox(
            self.get_widget("urls"),
            helper.get_repository_paths()
        )
        if self.url:
            self.urls.set_child_text(helper.unquote_url(self.url))

        # We must set a signal handler for the Gtk.Entry inside the combobox
        # Because glade will not retain that information
        self.urls.set_child_signal(
            "key-release-event",
            self.on_urls_key_released
        )

        self.revision_selector = rabbitvcs.ui.widget.RevisionSelector(
            self.get_widget("revision_container"),
            self.svn,
            url_combobox=self.urls,
            expand=True
        )

        self.items = []
        self.list_table = rabbitvcs.ui.widget.Table(
            self.get_widget("list"),
            [rabbitvcs.ui.widget.TYPE_PATH, GObject.TYPE_INT,
                GObject.TYPE_INT, GObject.TYPE_STRING, GObject.TYPE_FLOAT],
            [_("Path"), _("Revision"), _("Size"), _("Author"), _("Date")],
            filters=[{
                "callback": self.file_filter,
                "user_data": {
                    "column": 0
                }
            },{
                "callback": self.revision_filter,
                "user_data": {
                    "column": 1
                }
            },{
                "callback": self.size_filter,
                "user_data": {
                    "column": 2
                }
            },{
                "callback": self.date_filter,
                "user_data": {
                    "column": 4
                }
            }],
            filter_types=[GObject.TYPE_STRING, GObject.TYPE_STRING,
                GObject.TYPE_STRING, GObject.TYPE_STRING, GObject.TYPE_STRING],
            callbacks={
                "file-column-callback": self.file_column_callback,
                "row-activated": self.on_row_activated,
                "mouse-event":   self.on_list_table_mouse_event
            },
            flags={
                "sortable": True
            }
        )

        self.clipboard = None
        self.url_clipboard = Gtk.Clipboard()
        self.repo_root_url = None

        if self.url:
            helper.save_repository_path(url)
            self.load()