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


Python changelog.ChangeLog类代码示例

本文整理汇总了Python中webkitpy.common.checkout.changelog.ChangeLog的典型用法代码示例。如果您正苦于以下问题:Python ChangeLog类的具体用法?Python ChangeLog怎么用?Python ChangeLog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ChangeLog类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _ensure_bug_url

 def _ensure_bug_url(self, state):
     if not state.get("bug_id"):
         return
     bug_id = state.get("bug_id")
     changelogs = self.cached_lookup(state, "changelogs")
     for changelog_path in changelogs:
         changelog = ChangeLog(changelog_path)
         if not changelog.latest_entry().bug_id():
             changelog.set_short_description_and_bug_url(
                 self.cached_lookup(state, "bug_title"),
                 self._tool.bugs.bug_url_for_bug_id(bug_id))
开发者ID:,项目名称:,代码行数:11,代码来源:

示例2: _assert_message_for_revert_output

 def _assert_message_for_revert_output(self, args, expected_entry):
     changelog_contents = u"%s\n%s" % (changelog_unittest.ChangeLogTest._new_entry_boilerplate, changelog_unittest.ChangeLogTest._example_changelog)
     changelog_path = self._write_tmp_file_with_contents(changelog_contents.encode("utf-8"))
     changelog = ChangeLog(changelog_path)
     changelog.update_with_unreviewed_message(PrepareChangeLogForRevert._message_for_revert(*args))
     actual_entry = changelog.latest_entry()
     os.remove(changelog_path)
     self.assertEqual(actual_entry.contents(), expected_entry)
     self.assertEqual(actual_entry.reviewer_text(), None)
     # These checks could be removed to allow this to work on other entries:
     self.assertEqual(actual_entry.author_name(), "Eric Seidel")
     self.assertEqual(actual_entry.author_email(), "[email protected]")
开发者ID:EQ4,项目名称:h5vcc,代码行数:12,代码来源:preparechangelogforrevert_unittest.py

示例3: run

 def run(self, state):
     # FIXME: For now we disable this check when a user is driving the script
     # this check is too draconian (and too poorly tested) to foist upon users.
     if not self._options.non_interactive:
         return
     for changelog_path in self.cached_lookup(state, "changelogs"):
         changelog_entry = ChangeLog(changelog_path).latest_entry()
         if self._has_valid_reviewer(changelog_entry):
             continue
         reviewer_text = changelog_entry.reviewer_text()
         if reviewer_text:
             log("%s found in %s does not appear to be a valid reviewer according to committers.py." % (reviewer_text, changelog_path))
         error('%s neither lists a valid reviewer nor contains the string "Unreviewed" or "Rubber stamp" (case insensitive).' % changelog_path)
开发者ID:0x4d52,项目名称:JavaScriptCore-X,代码行数:13,代码来源:validatereviewer.py

示例4: _latest_entry_for_changelog_at_revision

 def _latest_entry_for_changelog_at_revision(self, changelog_path, revision):
     changelog_contents = self._scm.contents_at_revision(changelog_path, revision)
     # contents_at_revision returns a byte array (str()), but we know
     # that ChangeLog files are utf-8.  parse_latest_entry_from_file
     # expects a file-like object which vends unicode(), so we decode here.
     changelog_file = StringIO.StringIO(changelog_contents.decode("utf-8"))
     return ChangeLog.parse_latest_entry_from_file(changelog_file)
开发者ID:,项目名称:,代码行数:7,代码来源:

示例5: run

 def run(self, state):
     # FIXME: For now we disable this check when a user is driving the script
     # this check is too draconian (and too poorly tested) to foist upon users.
     if not self._options.non_interactive:
         return
     # FIXME: We should figure out how to handle the current working
     #        directory issue more globally.
     os.chdir(self._tool.scm().checkout_root)
     for changelog_path in self._tool.checkout().modified_changelogs(self._options.git_commit, self._options.squash):
         changelog_entry = ChangeLog(changelog_path).latest_entry()
         if self._has_valid_reviewer(changelog_entry):
             continue
         reviewer_text = changelog_entry.reviewer_text()
         if reviewer_text:
             log("%s found in %s does not appear to be a valid reviewer according to committers.py." % (reviewer_text, changelog_path))
         error('%s neither lists a valid reviewer nor contains the string "Unreviewed" or "Rubber stamp" (case insensitive).' % changelog_path)
开发者ID:UIKit0,项目名称:WebkitAIR,代码行数:16,代码来源:validatereviewer.py

示例6: commit_message_for_this_commit

    def commit_message_for_this_commit(self, git_commit, changed_files=None):
        changelog_paths = self.modified_changelogs(git_commit, changed_files)
        if not len(changelog_paths):
            raise ScriptError(message="Found no modified ChangeLogs, cannot create a commit message.\n"
                              "All changes require a ChangeLog.  See:\n %s" % urls.contribution_guidelines)

        changelog_messages = []
        for changelog_path in changelog_paths:
            log("Parsing ChangeLog: %s" % changelog_path)
            changelog_entry = ChangeLog(changelog_path).latest_entry()
            if not changelog_entry:
                raise ScriptError(message="Failed to parse ChangeLog: %s" % os.path.abspath(changelog_path))
            changelog_messages.append(changelog_entry.contents())

        # FIXME: We should sort and label the ChangeLog messages like commit-log-editor does.
        return CommitMessage("".join(changelog_messages).splitlines())
开发者ID:KDE,项目名称:android-qtwebkit,代码行数:16,代码来源:checkout.py

示例7: _latest_entry_for_changelog_at_revision

 def _latest_entry_for_changelog_at_revision(self, changelog_path, revision):
     changelog_contents = self._scm.contents_at_revision(changelog_path, revision)
     # contents_at_revision returns a byte array (str()), but we know
     # that ChangeLog files are utf-8.  parse_latest_entry_from_file
     # expects a file-like object which vends unicode(), so we decode here.
     # Old revisions of Sources/WebKit/wx/ChangeLog have some invalid utf8 characters.
     changelog_file = StringIO.StringIO(changelog_contents.decode("utf-8", "ignore"))
     return ChangeLog.parse_latest_entry_from_file(changelog_file)
开发者ID:Moondee,项目名称:Artemis,代码行数:8,代码来源:checkout.py

示例8: analyze

 def analyze(self):
     for path in self._changelog_paths:
         self._set_filename(self._filesystem.relpath(path, self._scm.checkout_root))
         with self._filesystem.open_text_file_for_reading(path) as changelog:
             self._print_status('Parsing entries...')
             number_of_parsed_entries = self._analyze_entries(ChangeLog.parse_entries_from_file(changelog), path)
         self._print_status('Done (%d entries)' % number_of_parsed_entries)
     print
     self._summary['contributors'] = len(self._contributors_statistics)
     self._summary['contributors_with_reviews'] = sum([1 for contributor in self._contributors_statistics.values() if contributor['reviews']['total']])
     self._summary['contributors_without_reviews'] = self._summary['contributors'] - self._summary['contributors_with_reviews']
开发者ID:Moondee,项目名称:Artemis,代码行数:11,代码来源:analyzechangelog.py

示例9: _resolve_existing_entry

    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:,项目名称:,代码行数:20,代码来源:

示例10: _latest_entry_for_changelog_at_revision

 def _latest_entry_for_changelog_at_revision(self, changelog_path, revision):
     changelog_contents = self._scm.contents_at_revision(changelog_path, revision)
     return ChangeLog.parse_latest_entry_from_file(StringIO.StringIO(changelog_contents))
开发者ID:mikezit,项目名称:Webkit_Code,代码行数:3,代码来源:api.py


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