Esempio n. 1
0
 def convert(*args, **kwargs):
     try:
         unbound(*args, **kwargs)
     except errors.NotBranchError:
         error_dialog(_i18n('Directory is not a branch'),
                      _i18n('You can perform this action only in a branch.'))
     except errors.LocalRequiresBoundBranch:
         error_dialog(_i18n('Directory is not a checkout'),
                      _i18n('You can perform local commit only on checkouts.'))
     except errors.PointlessCommit:
         error_dialog(_i18n('No changes to commit'),
                      _i18n('Try force commit if you want to commit anyway.'))
     except errors.PointlessMerge:
         info_dialog(_i18n('No changes to merge'),
                      _i18n('Merge location is already fully merged in working tree.'))
     except errors.ConflictsInTree:
         error_dialog(_i18n('Conflicts in tree'),
                      _i18n('You need to resolve the conflicts before committing.'))
     except errors.StrictCommitFailed:
         error_dialog(_i18n('Strict commit failed'),
                      _i18n('There are unknown files in the working tree.\nPlease add or delete them.'))
     except errors.BoundBranchOutOfDate, errmsg:
         error_dialog(_i18n('Bound branch is out of date'),
                      # FIXME: Really ? Internationalizing %s ?? --vila080505
                      _i18n('%s') % errmsg)
Esempio n. 2
0
    def _on_branch_clicked(self, button):
        """ Branch button clicked handler. """
        location = self._remote_branch.get_url()
        if location is '':
            error_dialog(_i18n('Missing branch location'),
                         _i18n('You must specify a branch location.'))
            return

        destination = self._filechooser.get_filename()
        try:
            revno = int(self._entry_revision.get_text())
        except:
            revno = None

        nick = self._entry_nick.get_text()
        if nick is '':
            nick = os.path.basename(location.rstrip("/\\"))

        br_from = Branch.open(location)

        br_from.lock_read()
        try:
            revision_id = br_from.get_rev_id(revno)

            basis_dir = None

            to_location = destination + os.sep + nick
            to_transport = get_transport(to_location)

            to_transport.mkdir('.')

            try:
                # preserve whatever source format we have.
                dir = br_from.bzrdir.sprout(to_transport.base,
                                            revision_id,
                                            basis_dir)
                branch = dir.open_branch()
                revs = branch.revno()
            except errors.NoSuchRevision:
                to_transport.delete_tree('.')
                raise
        finally:
            br_from.unlock()

        info_dialog(_i18n('Branching successful'),
                    _i18n('%d revision(s) branched.') % revs)

        self.response(Gtk.ResponseType.OK)
Esempio n. 3
0
 def _merge_successful(self):
     # No conflicts found.
     info_dialog(_i18n('Merge successful'),
                 _i18n('All changes applied successfully.'))