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