Commit 7ac4e590ac6e8768ba059ef151508e676fbd334d
- Diff rendering mode:
- inline
- side by side
cherry-pick-into-release-branch.py
(20 / 15)
|   | |||
| 151 | 151 | op.add_option("", "--no-auto-skip", default=False, action="store_true", help="don't add bugs to the skipped list automatically") | |
| 152 | 152 | op.add_option("", "--ignore-skipped", default=False, action="store_true", help="ignore the skipped list") | |
| 153 | 153 | op.add_option("", "--always-no", default=False, action="store_true", help="automatically answer no to all questions") | |
| 154 | op.add_option("", "--bugs", type="string", action="store", help="Check if patches from BUGS (comma separated list) have been included in this branch") | ||
| 154 | 155 | ||
| 155 | 156 | options = op.parse_args()[0] | |
| 156 | 157 | ||
| 158 | # (Strip off refs/heads/ and newline) | ||
| 159 | releaseBranch = run(["git", "symbolic-ref", "HEAD"])[11:-1] | ||
| 160 | |||
| 157 | 161 | masterBugs = [] | |
| 158 | for commit in masterBugsForBranch.keys(): | ||
| 159 | branches = run(["git", "branch", "--contains=%s" % commit]).split("\n") | ||
| 160 | for branch in branches: | ||
| 161 | if branch.startswith("* "): | ||
| 162 | masterBugs = masterBugsForBranch[commit] | ||
| 162 | |||
| 163 | if options.bugs: | ||
| 164 | bugs = options.bugs.split(",") | ||
| 165 | else: | ||
| 166 | for commit in masterBugsForBranch.keys(): | ||
| 167 | branches = run(["git", "branch", "--contains=%s" % commit]).split("\n") | ||
| 168 | for branch in branches: | ||
| 169 | if branch.startswith("* "): | ||
| 170 | masterBugs = masterBugsForBranch[commit] | ||
| 171 | break | ||
| 172 | if masterBugs: | ||
| 163 | 173 | break | |
| 164 | if masterBugs: | ||
| 165 | break | ||
| 166 | 174 | ||
| 167 | if not masterBugs: | ||
| 168 | die("Error, cannot detect on which branch you're on!") | ||
| 175 | if not masterBugs: | ||
| 176 | die("Error, cannot find a master bug for the branch you're on!") | ||
| 169 | 177 | ||
| 170 | # (Strip off refs/heads/ and newline) | ||
| 171 | releaseBranch = run(["git", "symbolic-ref", "HEAD"])[11:-1] | ||
| 178 | print "Querying Bugzilla for a list of bugs with patches that need to be back-ported" | ||
| 179 | bugs = bugsThatNeedToBeCherryPicked(masterBugs, releaseBranch, options.ignore_skipped) | ||
| 172 | 180 | ||
| 173 | print "Querying Bugzilla for a list of bugs with patches that need to be back-ported" | ||
| 174 | bugs = bugsThatNeedToBeCherryPicked(masterBugs, releaseBranch, options.ignore_skipped) | ||
| 181 | print "%s bugs found." % len(bugs) | ||
| 175 | 182 | ||
| 176 | 183 | bugzilla = CommentBugzilla(dryrun = False) | |
| 177 | 184 | bugzilla.authenticate() | |
| 178 | |||
| 179 | print "%s bugs found." % len(bugs) | ||
| 180 | 185 | ||
| 181 | 186 | commits = [] | |
| 182 | 187 | count = 0 |

