當前位置: 首頁>>代碼示例>>Python>>正文


Python ChangeLog.delete_entries方法代碼示例

本文整理匯總了Python中webkitpy.common.checkout.changelog.ChangeLog.delete_entries方法的典型用法代碼示例。如果您正苦於以下問題:Python ChangeLog.delete_entries方法的具體用法?Python ChangeLog.delete_entries怎麽用?Python ChangeLog.delete_entries使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在webkitpy.common.checkout.changelog.ChangeLog的用法示例。


在下文中一共展示了ChangeLog.delete_entries方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _resolve_existing_entry

# 需要導入模塊: from webkitpy.common.checkout.changelog import ChangeLog [as 別名]
# 或者: from webkitpy.common.checkout.changelog.ChangeLog import delete_entries [as 別名]
    def _resolve_existing_entry(self, changelog_path):
        # When this is called, the top entry in the ChangeLog was just created
        # by prepare-ChangeLog, as an clean updated version of the one below it.
        with self._tool.filesystem.open_text_file_for_reading(changelog_path) as changelog_file:
            entries_gen = ChangeLog.parse_entries_from_file(changelog_file)
            entries = zip(entries_gen, range(2))

        if not len(entries):
            raise Exception("Expected to find at least two ChangeLog entries in %s but found none." % changelog_path)
        if len(entries) == 1:
            # If we get here, it probably means we've just rolled over to a
            # new CL file, so we don't have anything to resolve.
            return

        (new_entry, _), (old_entry, _) = entries
        final_entry = self._merge_entries(old_entry, new_entry)

        changelog = ChangeLog(changelog_path, self._tool.filesystem)
        changelog.delete_entries(2)
        changelog.prepend_text(final_entry)
開發者ID:,項目名稱:,代碼行數:22,代碼來源:


注:本文中的webkitpy.common.checkout.changelog.ChangeLog.delete_entries方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。