Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Unified Diff: scripts/slave/bot_update.py

Issue 1387213002: When applying a gerrit patch, do a checkout before soft resetting. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: strip rev-parse output Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/slave/bot_update.py
diff --git a/scripts/slave/bot_update.py b/scripts/slave/bot_update.py
index ea50ab0f71e0669421009b859dc171cfe2f9bc6f..b3c1c97f24789c6ec320b37a1200d8ca6419d51c 100755
--- a/scripts/slave/bot_update.py
+++ b/scripts/slave/bot_update.py
@@ -1107,8 +1107,10 @@ def apply_gerrit_ref(gerrit_repo, gerrit_ref, root):
gerrit_repo = gerrit_repo or 'origin'
assert gerrit_ref
try:
+ base_rev = git('rev-parse', 'HEAD', cwd=root).strip()
git('retry', 'fetch', gerrit_repo, gerrit_ref, cwd=root, tries=1)
- git('reset', '--soft', 'FETCH_HEAD', cwd=root)
+ git('checkout', 'FETCH_HEAD', cwd=root)
+ git('reset', '--soft', base_rev, cwd=root)
except SubprocessFailed as e:
raise PatchFailed(e.message, e.code, e.output)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698