def do(self): if self.model.mode == self.model.mode_branch: # We're applying changes from a different branch! parser = DiffParser(self.model, filename=self.model.filename, cached=False, branch=self.model.head) status, output = \ parser.process_diff_selection(self.selected, self.offset, self.selection, apply_to_worktree=True) else: # The normal worktree vs index scenario parser = DiffParser(self.model, filename=self.model.filename, cached=self.staged, reverse=self.apply_to_worktree) status, output = \ parser.process_diff_selection(self.selected, self.offset, self.selection, apply_to_worktree= self.apply_to_worktree) _notifier.broadcast(signals.log_cmd, status, output) # Redo the diff to show changes if self.staged: diffcmd = DiffStaged([self.model.filename]) else: diffcmd = Diff([self.model.filename]) diffcmd.do() self.model.update_file_status()
def do(self): # The normal worktree vs index scenario parser = DiffParser(self.model, filename=self.model.filename, cached=self.staged, reverse=self.apply_to_worktree) status, out, err = \ parser.process_diff_selection(self.offset, self.selection_text, apply_to_worktree=self.apply_to_worktree) Interaction.log_status(status, out, err) self.model.update_file_status(update_index=True)
def do(self): # The normal worktree vs index scenario parser = DiffParser( self.model, filename=self.model.filename, cached=self.staged, reverse=self.apply_to_worktree ) status, output = parser.process_diff_selection( self.selected, self.offset, self.selection, apply_to_worktree=self.apply_to_worktree ) _notifier.broadcast(signals.log_cmd, status, output) # Redo the diff to show changes if self.staged: diffcmd = DiffStaged([self.model.filename]) else: diffcmd = Diff([self.model.filename]) diffcmd.do() self.model.update_file_status()
def do(self): # The normal worktree vs index scenario parser = DiffParser(self.model, filename=self.model.filename, cached=self.staged, reverse=self.apply_to_worktree) status, output = \ parser.process_diff_selection(self.selected, self.offset, self.selection, apply_to_worktree=self.apply_to_worktree) _notifier.broadcast(signals.log_cmd, status, output) # Redo the diff to show changes if self.staged: diffcmd = DiffStaged([self.model.filename]) else: diffcmd = Diff([self.model.filename]) diffcmd.do() self.model.update_file_status()