Ejemplo n.º 1
0
 def compare_file(self, filename):
     """Initiates the difftool session"""
     if self.use_sandbox:
         arg = self.diff_arg
     else:
         arg = (self.start, self.end)
     difftool.launch(arg + ('--', filename))
Ejemplo n.º 2
0
 def difftool_selected(self, files):
     bottom, top = self.treewidget.selected_commit_range()
     if not top:
         return
     difftool.launch(left=bottom,
                     left_take_parent=True,
                     right=top,
                     paths=files)
Ejemplo n.º 3
0
 def difftool_predecessor(self, paths):
     """Prompt for an older commit and launch difftool against it."""
     args = ['--'] + paths
     revs, summaries = gitcmds.log_helper(all=False, extra_args=args)
     commits = select_commits(N_('Select Previous Version'),
                              revs, summaries, multiselect=False)
     if not commits:
         return
     commit = commits[0]
     difftool.launch([commit, '--'] + paths)
Ejemplo n.º 4
0
 def compare_file(self, filename):
     """Initiates the difftool session"""
     if self.use_sandbox:
         left = self.diff_arg[0]
         if len(self.diff_arg) > 1:
             right = self.diff_arg[1]
         else:
             right = None
     else:
         left, right = self.start, self.end
     difftool.launch(left=left, right=right, paths=[filename])
Ejemplo n.º 5
0
 def do(self):
     if not self.filenames:
         return
     args = []
     if self.staged:
         args.append('--cached')
     if self.model.head != 'HEAD':
         args.append(self.model.head)
     args.append('--')
     args.extend(self.filenames)
     difftool.launch(args)
Ejemplo n.º 6
0
 def diff_commits(self, a, b):
     paths = self.dag.paths()
     if paths:
         difftool.launch([a, b, '--'] + paths)
     else:
         difftool.diff_commits(self, a, b)
Ejemplo n.º 7
0
 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)