def _update_callback(self): """Update the title with the current branch and directory name.""" branch = self.model.currentbranch curdir = core.decode(os.getcwd()) msg = 'Repository: %s\nBranch: %s' % (curdir, branch) self.commitdockwidget.setToolTip(msg) title = '%s [%s]' % (self.model.project, branch) if self.mode in (self.model.mode_diff, self.model.mode_diff_expr): title += ' *** diff mode***' elif self.mode == self.model.mode_review: title += ' *** review mode***' elif self.mode == self.model.mode_amend: title += ' *** amending ***' self.setWindowTitle(title) if self.mode != self.model.mode_amend: self.amend_checkbox.blockSignals(True) self.amend_checkbox.setChecked(False) self.amend_checkbox.blockSignals(False) if not self.model.read_only() and self.mode != self.model.mode_amend: # Check if there's a message file in .git/ merge_msg_path = gitcmds.merge_message_path() if merge_msg_path is None: return merge_msg_hash = utils.checksum(core.decode(merge_msg_path)) if merge_msg_hash == self.merge_message_hash: return self.merge_message_hash = merge_msg_hash cola.notifier().broadcast(signals.load_commit_message, core.decode(merge_msg_path))
def _update_callback(self): """Update the title with the current branch and directory name.""" branch = self.model.currentbranch curdir = core.decode(os.getcwd()) msg = N_('Repository: %s') % curdir msg += '\n' msg += N_('Branch: %s') % branch self.commitdockwidget.setToolTip(msg) title = '%s: %s (%s)' % (self.model.project, branch, self.model.git.worktree()) if self.mode == self.model.mode_amend: title += ' (%s)' % N_('Amending') self.setWindowTitle(title) self.commitmsgeditor.set_mode(self.mode) if not self.model.amending(): # Check if there's a message file in .git/ merge_msg_path = gitcmds.merge_message_path() if merge_msg_path is None: return merge_msg_hash = utils.checksum(core.decode(merge_msg_path)) if merge_msg_hash == self.merge_message_hash: return self.merge_message_hash = merge_msg_hash cmds.do(cmds.LoadCommitMessage, core.decode(merge_msg_path))
def _update_callback(self): """Update the title with the current branch and directory name.""" branch = self.model.currentbranch curdir = core.decode(os.getcwd()) msg = 'Repository: %s\nBranch: %s' % (curdir, branch) self.commitdockwidget.setToolTip(msg) title = '%s: %s' % (self.model.project, branch) if self.mode == self.model.mode_amend: title += ' ** amending **' self.setWindowTitle(title) self.commitmsgeditor.set_mode(self.mode) if not self.model.amending(): # Check if there's a message file in .git/ merge_msg_path = gitcmds.merge_message_path() if merge_msg_path is None: return merge_msg_hash = utils.checksum(core.decode(merge_msg_path)) if merge_msg_hash == self.merge_message_hash: return self.merge_message_hash = merge_msg_hash cola.notifier().broadcast(signals.load_commit_message, core.decode(merge_msg_path))
def _update_view(self): """Update the title with the current branch and directory name.""" title = '%s [%s]' % (self.model.project, self.model.currentbranch) if self.mode in (self.model.mode_diff, self.model.mode_diff_expr): title += ' *** diff mode***' elif self.mode == self.model.mode_review: title += ' *** review mode***' elif self.mode == self.model.mode_amend: title += ' *** amending ***' self.setWindowTitle(title) if self.mode != self.model.mode_amend: self.amend_checkbox.blockSignals(True) self.amend_checkbox.setChecked(False) self.amend_checkbox.blockSignals(False) if not self.model.read_only() and self.mode != self.model.mode_amend: # Check if there's a message file in .git/ merge_msg_path = gitcmds.merge_message_path() if merge_msg_path is None: return merge_msg_hash = utils.checksum(merge_msg_path) if merge_msg_hash == self.merge_message_hash: return self.merge_message_hash = merge_msg_hash cola.notifier().broadcast(signals.load_commit_message, merge_msg_path)
def _update_callback(self): """Update the title with the current branch and directory name.""" alerts = [] branch = self.model.currentbranch curdir = core.getcwd() is_merging = self.model.is_merging is_rebasing = self.model.is_rebasing msg = N_("Repository: %s") % curdir msg += "\n" msg += N_("Branch: %s") % branch if is_rebasing: msg += "\n\n" msg += N_( "This repository is currently being rebased.\n" "Resolve conflicts, commit changes, and run:\n" " Rebase > Continue" ) alerts.append(N_("Rebasing")) elif is_merging: msg += "\n\n" msg += N_("This repository is in the middle of a merge.\n" "Resolve conflicts and commit changes.") alerts.append(N_("Merging")) if self.mode == self.model.mode_amend: alerts.append(N_("Amending")) l = unichr(0xAB) r = unichr(0xBB) title = "%s: %s %s%s" % ( self.model.project, branch, alerts and ((r + " %s " + l + " ") % ", ".join(alerts)) or "", self.model.git.worktree(), ) self.setWindowTitle(title) self.commitdockwidget.setToolTip(msg) self.commitmsgeditor.set_mode(self.mode) self.update_actions() if not self.model.amending(): # Check if there's a message file in .git/ merge_msg_path = gitcmds.merge_message_path() if merge_msg_path is None: return merge_msg_hash = utils.checksum(merge_msg_path) if merge_msg_hash == self.merge_message_hash: return self.merge_message_hash = merge_msg_hash cmds.do(cmds.LoadCommitMessageFromFile, merge_msg_path)
def _update_callback(self): """Update the title with the current branch and directory name.""" alerts = [] branch = self.model.currentbranch curdir = core.getcwd() is_merging = self.model.is_merging is_rebasing = self.model.is_rebasing msg = N_('Repository: %s') % curdir msg += '\n' msg += N_('Branch: %s') % branch if is_rebasing: msg += '\n\n' msg += N_('This repository is currently being rebased.\n' 'Resolve conflicts, commit changes, and run:\n' ' Rebase > Continue') alerts.append(N_('Rebasing')) elif is_merging: msg += '\n\n' msg += N_('This repository is in the middle of a merge.\n' 'Resolve conflicts and commit changes.') alerts.append(N_('Merging')) if self.mode == self.model.mode_amend: alerts.append(N_('Amending')) l = unichr(0xab) r = unichr(0xbb) title = ('%s: %s %s%s' % ( self.model.project, branch, alerts and ((r+' %s '+l+' ') % ', '.join(alerts)) or '', self.model.git.worktree())) self.setWindowTitle(title) self.commitdockwidget.setToolTip(msg) self.commitmsgeditor.set_mode(self.mode) self.update_actions() if not self.model.amending(): # Check if there's a message file in .git/ merge_msg_path = gitcmds.merge_message_path() if merge_msg_path is None: return merge_msg_hash = utils.checksum(merge_msg_path) if merge_msg_hash == self.merge_message_hash: return self.merge_message_hash = merge_msg_hash cmds.do(cmds.LoadCommitMessageFromFile, merge_msg_path)
def _update_callback(self): """Update the title with the current branch and directory name.""" branch = self.model.currentbranch curdir = core.getcwd() is_rebasing = self.model.is_rebasing msg = N_('Repository: %s') % curdir msg += '\n' msg += N_('Branch: %s') % branch if is_rebasing: msg += '\n\n' msg += N_('This repository is currently being rebased.\n' 'Resolve conflicts, commit changes, and run:\n' ' Rebase > Continue') self.commitdockwidget.setToolTip(msg) alerts = [] if is_rebasing: alerts.append(N_('Rebasing').upper()) if self.mode == self.model.mode_amend: alerts.append(N_('Amending').upper()) l = unichr(0xab) r = unichr(0xbb) title = ('%s: %s %s%s' % ( self.model.project, branch, alerts and ((r+' %s '+l+' ') % ', '.join(alerts)) or '', self.model.git.worktree())) self.setWindowTitle(title) self.commitmsgeditor.set_mode(self.mode) self.update_rebase_actions(is_rebasing) if not self.model.amending(): # Check if there's a message file in .git/ merge_msg_path = gitcmds.merge_message_path() if merge_msg_path is None: return merge_msg_hash = utils.checksum(merge_msg_path) if merge_msg_hash == self.merge_message_hash: return self.merge_message_hash = merge_msg_hash cmds.do(cmds.LoadCommitMessageFromFile, merge_msg_path)