本文整理匯總了Python中cola.diffparse.DiffParser.process_diff_selection方法的典型用法代碼示例。如果您正苦於以下問題:Python DiffParser.process_diff_selection方法的具體用法?Python DiffParser.process_diff_selection怎麽用?Python DiffParser.process_diff_selection使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類cola.diffparse.DiffParser
的用法示例。
在下文中一共展示了DiffParser.process_diff_selection方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: do
# 需要導入模塊: from cola.diffparse import DiffParser [as 別名]
# 或者: from cola.diffparse.DiffParser import process_diff_selection [as 別名]
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()
示例2: do
# 需要導入模塊: from cola.diffparse import DiffParser [as 別名]
# 或者: from cola.diffparse.DiffParser import process_diff_selection [as 別名]
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)
示例3: do
# 需要導入模塊: from cola.diffparse import DiffParser [as 別名]
# 或者: from cola.diffparse.DiffParser import process_diff_selection [as 別名]
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()