当前位置: 首页>>代码示例>>Python>>正文


Python DiffParser.process_diff_selection方法代码示例

本文整理汇总了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()
开发者ID:kbielefe,项目名称:git-cola,代码行数:34,代码来源:cmds.py

示例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)
开发者ID:fluffynuts,项目名称:git-cola,代码行数:14,代码来源:cmds.py

示例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()
开发者ID:rakoo,项目名称:git-cola,代码行数:18,代码来源:cmds.py


注:本文中的cola.diffparse.DiffParser.process_diff_selection方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。