當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。