From a680c23e78599f7f0b761ada3158387a9e9a05b3 Mon Sep 17 00:00:00 2001 From: Edward Lesmes Date: Tue, 31 Mar 2020 18:26:44 +0000 Subject: [PATCH] git-cl: Fix checking if parent branch has been uploaded. The old behavior was to set parent from the gerritsquashhash of the parent branch, but now it's trying to set it from the gerritsquashhash of the current branch (which doesn't exist yet). As a result it's always saying `Upload upstream branch ... first` Change-Id: I035ed128f46a49d09d563ea589e9ca9eb7b87db9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2128679 Reviewed-by: Josip Sokcevic Commit-Queue: Edward Lesmes --- git_cl.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/git_cl.py b/git_cl.py index 8b59c49cdd..30800918dc 100755 --- a/git_cl.py +++ b/git_cl.py @@ -2349,7 +2349,8 @@ class Changelist(object): # the tree hash of the parent branch. The upside is less likely bogus # requests to reupload parent change just because it's uploadhash is # missing, yet the downside likely exists, too (albeit unknown to me yet). - parent = self._GitGetBranchConfigValue('gerritsquashhash', '') + parent = scm.GIT.GetBranchConfig( + settings.GetRoot(), upstream_branch_name, 'gerritsquashhash') # Verify that the upstream branch has been uploaded too, otherwise # Gerrit will create additional CLs when uploading. if not parent or (RunGitSilent(['rev-parse', upstream_branch + ':']) !=