Exemplo n.º 1
0
    def __init__(self, path):
        InterfaceNonView.__init__(self)
        self.register_gtk_quit()

        self.vcs = rabbitvcs.vcs.VCS()

        self.path = path

        if not os.path.exists(self.path):
            MessageBox(_("The requested file or folder does not exist."))
            sys.exit(-1)
            return

        dialog = OneLineTextChange(_("Rename"), _("New Name:"), self.path)

        label2 = dialog.get_widget("label2")
        orgtext = dialog.get_widget("org_text")

        orgtext.set_text(self.path)

        label2.set_property("visible", True)
        orgtext.set_property("visible", True)

        (result, new_path) = dialog.run()

        if result != Gtk.ResponseType.OK:
            sys.exit(-1)
            return

        if not new_path:
            MessageBox(_("The new name field is required"))

        self.new_path = new_path
        self.DO_RENAME = True
Exemplo n.º 2
0
    def __init__(self, path):
        InterfaceNonView.__init__(self)
        self.register_gtk_quit()

        self.vcs = rabbitvcs.vcs.VCS()

        self.path = path

        if not os.path.exists(self.path):
            MessageBox(_("The requested file or folder does not exist."))
            self.close()
            return

        dialog = OneLineTextChange(_("Rename"), _("New Name:"), self.path)
        (result, new_path) = dialog.run()

        if result != Gtk.ResponseType.OK:
            self.close()
            return

        if not new_path:
            MessageBox(_("The new name field is required"))

        self.new_path = new_path
        self.DO_RENAME = True
Exemplo n.º 3
0
    def on_ok_clicked(self, widget):
        url = self.repositories.get_active_text()
        path = self._get_path()

        if not url or not path:
            MessageBox(
                _("The repository URL and destination path are both required fields."
                  ))
            return

        if url.startswith("file://"):
            url = self._parse_path(url)

        # Cannot do:
        # url = os.path.normpath(url)
        # ...in general, since it might be eg. an http URL. Doesn't seem to
        # affect pySvn though.

        path = os.path.normpath(path)
        revision = self.revision_selector.get_revision_object()

        self.hide()
        self.action = GitAction(self.git,
                                register_gtk_quit=self.gtk_quit_is_set())

        self.action.append(self.action.set_header, _("Export"))
        self.action.append(self.action.set_status,
                           _("Running Export Command..."))
        self.action.append(rabbitvcs.util.helper.save_repository_path, url)
        self.action.append(self.git.export, url, path, revision=revision)
        self.action.append(self.action.set_status, _("Completed Export"))
        self.action.append(self.action.finish)
        self.action.start()
Exemplo n.º 4
0
    def __init__(self, path, revision=None):
        if os.path.isdir(path):
            MessageBox(_("Cannot annotate a directory"))
            raise SystemExit()
            return

        InterfaceView.__init__(self, "annotate", "Annotate")

        self.get_widget("Annotate").set_title(_("Annotate - %s") % path)
        self.vcs = rabbitvcs.vcs.VCS()

        sm = SettingsManager()
        self.datetime_format = sm.get("general", "datetime_format")
        self.colorize = sm.get("general", "enable_colorize")

        self.log_by_order = []
        self.log_by_revision = {}
        self.author_background = {}
        self.history = [revision or "HEAD"]
        self.history_index = 0
        self.loading_dialog = None

        self.table = self.build_table()
        self.revision = self.get_widget("revision")
        self.history_first = Clickable(self.get_widget("history_first"))
        self.history_prev = Clickable(self.get_widget("history_prev"))
        self.history_next = Clickable(self.get_widget("history_next"))
        self.history_last = Clickable(self.get_widget("history_last"))
        self.history_first.connect("single-click", self.on_history_first)
        self.history_prev.connect("single-click", self.on_history_prev)
        self.history_prev.connect("long-click", self.history_popup_menu)
        self.history_next.connect("single-click", self.on_history_next)
        self.history_next.connect("long-click", self.history_popup_menu)
        self.history_last.connect("single-click", self.on_history_last)
        self.set_history_sensitive()
Exemplo n.º 5
0
    def load(self):
        from_rev_num = self.get_widget("from").get_text().lower()
        to_rev_num = self.get_widget("to").get_text().lower()
        
        if not from_rev_num.isdigit():
            MessageBox(_("The from revision field must be an integer"))
            return
             
        from_rev = self.svn.revision("number", number=int(from_rev_num))
        
        to_rev = self.svn.revision("head")
        if to_rev_num.isdigit():
            to_rev = self.svn.revision("number", number=int(to_rev_num))
        
        self.action = SVNAction(
            self.svn,
            notification=False
        )    

        self.action.append(
            self.svn.annotate,
            self.path,
            from_rev,
            to_rev
        )
        self.action.append(self.populate_table)
        self.action.append(self.enable_saveas)
        self.action.start()
Exemplo n.º 6
0
    def __init__(self, path, revision=None):
        if os.path.isdir(path):
            MessageBox(_("Cannot annotate a directory"))
            raise SystemExit()
            return

        InterfaceView.__init__(self, "annotate", "Annotate")

        self.get_widget("Annotate").set_title(_("Annotate - %s") % path)
        self.vcs = rabbitvcs.vcs.VCS()
Exemplo n.º 7
0
    def on_ok_clicked(self, widget):
        url = self.repositories.get_active_text()
        path = self._get_path()
        omit_externals = self.get_widget("omit_externals").get_active()
        recursive = self.get_widget("recursive").get_active()

        if not url or not path:
            MessageBox(
                _("The repository URL and destination path are both required fields."
                  ))
            return

        if url.startswith("file://"):
            url = self._parse_path(url)

        # Cannot do:
        # url = os.path.normpath(url)
        # ...in general, since it might be eg. an http URL. Doesn't seem to
        # affect pySvn though.

        path = os.path.normpath(path)
        revision = self.revision_selector.get_revision_object()

        self.hide()
        self.action = SVNAction(self.svn,
                                register_gtk_quit=self.gtk_quit_is_set())

        self.action.append(self.action.set_header, _("Export"))
        self.action.append(self.action.set_status,
                           _("Running Export Command..."))
        self.action.append(helper.save_repository_path, url)
        self.action.append(self.svn.export,
                           url,
                           path,
                           force=True,
                           recurse=recursive,
                           revision=revision,
                           ignore_externals=omit_externals)
        self.action.append(self.action.set_status, _("Completed Export"))
        self.action.append(self.action.finish)
        self.action.schedule()
Exemplo n.º 8
0
    def on_ok_clicked(self, widget):

        from_url = self.get_widget("from_url").get_text()
        to_url = self.get_widget("to_url").get_text()

        if not from_url or not to_url:
            MessageBox(_("The from and to url fields are both required."))
            return

        self.hide()

        self.action = SVNAction(self.svn,
                                register_gtk_quit=self.gtk_quit_is_set())

        self.action.append(self.action.set_header, _("Relocate"))
        self.action.append(self.action.set_status,
                           _("Running Relocate Command..."))
        self.action.append(self.svn.relocate, from_url, to_url, self.path)
        self.action.append(self.action.set_status, _("Completed Relocate"))
        self.action.append(self.action.finish)
        self.action.start()
Exemplo n.º 9
0
 def exception_callback(self, e):
     log.exception(e)
     MessageBox(str(e))
Exemplo n.º 10
0
 def exception_callback(self, e):
     if not self.was_canceled_by_user:
         log.exception(e)
         MessageBox(str(e))