• Home
  • Raw
  • Download

Lines Matching +full:commit +full:- +full:message +full:- +full:check

3 # Use of this source code is governed by a BSD-style license that can be
9 # account (and are enabled with --is-bot).
11 # See `./tools/chromeos/merge_bot -h` for details.
30 git_log = git("log --decorate=no --color=never")
31 curl = cmd("curl --silent --fail")
40 MERGE_TAG = "testing-crosvm-merge"
41 DRY_RUN_TAG = "testing-crosvm-merge-dry-run"
43 MERGE_TAG = "crosvm-merge" # type: ignore
44 DRY_RUN_TAG = "crosvm-merge-dry-run" # type: ignore
47 LUCI_EMAIL = "chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com"
75 f"-age:{age}",
81 "Returns a string with all BUG=... lines of the specified commit range."
85 for line in git_log(commit_range, "--pretty=%b").lines()
93 git("fetch -q cros", tracking).fg()
95 git("branch -D", branch_name).fg(quiet=True, check=False)
96 git("checkout -b", branch_name, "--track", f"cros/{tracking}").fg()
103 old_head = git("symbolic-ref -q --short HEAD").stdout(check=False)
105 old_head = git("rev-parse HEAD").stdout()
115 if git("remote get-url cros").fg(check=False) != 0:
118 actual_remote = git("remote get-url cros").stdout()
122 # Install gerrit Change-Id hook
123 hook_path = CROSVM_ROOT / ".git/hooks/commit-msg"
126 curl(f"{GERRIT_URL}/tools/hooks/commit-msg").write_to(hook_path)
132 extra_params = ("r=crosvm-uprev@google.com", *extra_params)
148 "Merges `revision` into HEAD, creating merge commits including at most `max-size` commits."
152 commits = git_log(f"HEAD..{revision}", "--pretty=%H").lines()
157 # Create a merge commit for each batch
162 previous_rev = git(f"rev-parse {batch[-1]}^").stdout()
165 # Put together a message containing info about what's in the merge.
168 message = "\n\n".join(
171 git_log(commit_range, "--oneline").stdout(),
178 trailers = "Commit: False" if create_dry_run or TESTING else ""
181 code = git("merge --no-ff", target, "-m", quoted(message), "-m", quoted(trailers)).fg(
182 check=False
187 print("Merge has conflicts. Creating commit with conflict markers.")
188 git("add --update .").fg()
189 message = f"(CONFLICT) {message}"
190 git("commit", "-m", quoted(message), "-m", quoted(trailers)).fg()
215 parsed_revision = git("rev-parse", revision).stdout()
225 with tracking_branch_context("merge-bot-branch", target_branch):
233 labels.append("l=Commit-Queue+1")
235 labels.append("l=Bot-Commit+1")
250 parsed_revision = git("rev-parse", revision).stdout()
255 cq_votes = dry_run.get_votes("Commit-Queue")
260 # Check for luci results and add V+-1 votes to make it easier to identify failed dry runs.
266 last_luci_message = luci_messages[-1]
274 "Bot-Commit": 0,
283 "Verified": -1,
284 "Bot-Commit": 0,
304 with tracking_branch_context("merge-bot-branch", target_branch):
310 *(["l=Commit-Queue+1"] if not TESTING else []),
311 *(["l=Bot-Commit+1"] if is_bot else []),
315 print("Not uploading dry-run with conflicts.")