Changeset 47005 in webkit


Ignore:
Timestamp:
Aug 10, 2009 2:53:10 PM (15 years ago)
Author:
ddkilzer@apple.com
Message:

<http://webkit.org/b/28163> bugzilla-tool: scm module should not import bugzilla module

Reviewed by David Levin.

  • Scripts/bugzilla-tool: (parse_bug_id): Added. Moved from CommitMessage.parse_bug_id() in scm module.
  • Scripts/modules/scm.py: Removed import of bugzilla module. (CommitMessage.parse_bug_id): Deleted.
Location:
trunk/WebKitTools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r46988 r47005  
     12009-08-10  David Kilzer  <ddkilzer@apple.com>
     2
     3        <http://webkit.org/b/28163> bugzilla-tool: scm module should not import bugzilla module
     4
     5        Reviewed by David Levin.
     6
     7        * Scripts/bugzilla-tool:
     8        (parse_bug_id): Added.  Moved from CommitMessage.parse_bug_id()
     9        in scm module.
     10        * Scripts/modules/scm.py: Removed import of bugzilla module.
     11        (CommitMessage.parse_bug_id): Deleted.
     12
    1132009-08-10  Peter Kasting  <pkasting@google.com>
    214
  • trunk/WebKitTools/Scripts/bugzilla-tool

    r46954 r47005  
    9797    return changelog_paths
    9898
     99def parse_bug_id(commit_message):
     100    message = commit_message.message()
     101    match = re.search("http\://webkit\.org/b/(?P<bug_id>\d+)", message)
     102    if match:
     103        return match.group('bug_id')
     104    match = re.search(Bugzilla.bug_server_regex + "show_bug\.cgi\?id=(?P<bug_id>\d+)", message)
     105    if match:
     106        return match.group('bug_id')
     107    return None
     108
    99109def commit_message_for_this_commit(scm):
    100110    changelog_paths = modified_changelogs(scm)
     
    449459            commit_message = tool.scm().commit_message_for_local_commit(commit_id)
    450460
    451             bug_id = options.bug_id or commit_message.parse_bug_id()
     461            bug_id = options.bug_id or parse_bug_id(commit_message)
    452462            if not bug_id:
    453463                log("Skipping %s: No bug id found in commit log or specified with --bug-id." % commit_id)
  • trunk/WebKitTools/Scripts/modules/scm.py

    r46772 r47005  
    3636# Import WebKit-specific modules.
    3737from modules.logging import error, log
    38 from modules.bugzilla import Bugzilla # FIXME: This should not be imported by scm.py
    3938
    4039def detect_scm_system(path):
     
    7776    def message(self):
    7877        return "\n".join(self.message_lines) + "\n"
    79 
    80     def parse_bug_id(self):
    81         for line in self.message_lines:
    82             match = re.search("http\://webkit\.org/b/(?P<bug_id>\d+)", line)
    83             if match:
    84                 return match.group('bug_id')
    85             match = re.search(Bugzilla.bug_server_regex + "show_bug\.cgi\?id=(?P<bug_id>\d+)", line)
    86             if match:
    87                 return match.group('bug_id')
    88         return None
    8978
    9079
Note: See TracChangeset for help on using the changeset viewer.