def review_branch(): """Diff against an arbitrary revision, branch, tag, etc.""" branch = choose_ref(N_('Select Branch to Review'), N_('Review')) if not branch: return merge_base = gitcmds.merge_base_parent(branch) difftool.diff_commits(qtutils.active_window(), merge_base, branch)
def diff_revision(): """Diff an arbitrary revision against the worktree""" ref = choose_ref('Select Revision to Diff', 'Diff', default='HEAD^') if not ref: return difftool.diff_commits(qtutils.active_window(), ref, None)
def diff_commits(self, a, b): paths = self.dag.paths() if paths: difftool.launch([a, b, '--'] + paths) else: difftool.diff_commits(self, a, b)
def _diff_selected_this(self): clicked_sha1 = self._clicked_item.commit.sha1 selected_sha1 = self._selected_item.commit.sha1 difftool.diff_commits(self, selected_sha1, clicked_sha1)
def diff_commits(self, a, b): paths = self.ctx.paths() if paths: difftool.launch(left=a, right=b, paths=paths) else: difftool.diff_commits(self, a, b)