def _hg_commit(self, files): if not self.repo.ui.config('ui', 'username'): Prompt('Username not configured', 'Please enter a username', self).run() from thgconfig import ConfigDialog dlg = ConfigDialog(self.repo.root, False) dlg.show_all() dlg.focus_field('ui.username') dlg.run() dlg.hide() self.repo = hg.repository(ui.ui(), self.repo.root) self.ui = self.repo.ui # call the threaded CmdDialog to do the commit, so the the large commit # won't get locked up by potential large commit. CmdDialog will also # display the progress of the commit operation. cmdline = ["hg", "commit", "--verbose", "--repository", self.repo.root] if self.opts['addremove']: cmdline += ['--addremove'] cmdline += ['--message', fromutf(self.opts['message'])] cmdline += [self.repo.wjoin(x) for x in files] dialog = CmdDialog(cmdline, True) dialog.set_transient_for(self) dialog.run() dialog.hide() # refresh overlay icons and commit dialog if dialog.return_code() == 0: self.text.set_buffer(gtk.TextBuffer()) self._update_recent_messages(self.opts['message']) shell_notify([self.cwd] + files) self._last_commit_id = self._get_tip_rev(True) self.reload_status()
def _grep_selection_changed(self, treeview): """ Callback for when the user selects grep output. """ (path, focus) = treeview.get_cursor() model = treeview.get_model() if path is not None and model is not None: iter = model.get_iter(path) self.currev = model[iter][self.COL_REVID] self.curpath = fromutf(model[iter][self.COL_PATH]) self.stbar.set_status_text(toutf(model[iter][self.COL_TOOLTIP]))
def _filelist_rowchanged(self, sel): model, iter = sel.get_selected() if not iter: return # scroll to file in details window mark = self._buffer.get_mark(model[iter][2]) self.textview.scroll_to_mark(mark, 0.0, True, 0.0, 0.0) if model[iter][3]: self.curfile = fromutf(model[iter][1]) else: self.curfile = None