summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@gmx.de>2020-12-23 22:18:25 +0100
committerOswald Buddenhagen <oswald.buddenhagen@gmx.de>2021-05-18 11:05:05 +0000
commita257d4c84ccff770f65956299ff3f8bba67fa5c0 (patch)
tree7d94850c3d1117139ee81752ece79f6b10c860c0
parentc1accae53e7c52dcc522664608cbc1fe60609b54 (diff)
downloadqtrepotools-a257d4c84ccff770f65956299ff3f8bba67fa5c0.tar.gz
gpick: avoid pointless fetches of own PatchSets
when we already have the commit in a Change's _pushed ref, we can just alias it to the fetch ref. Change-Id: I8ba02fe800223ad8226355df8374f95bdb5a2e60 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rwxr-xr-xbin/git-gpick9
1 files changed, 8 insertions, 1 deletions
diff --git a/bin/git-gpick b/bin/git-gpick
index 08735c3..db3393c 100755
--- a/bin/git-gpick
+++ b/bin/git-gpick
@@ -1059,7 +1059,14 @@ sub fetch_patchsets($$;$)
} elsif ($commit_by_id{$rev_id}) {
# When we are fetching the dependencies of Changes we already fetched,
# it is quite likely that we already have the corresponding commits.
- print "Already have PatchSet $rev_ps for $$ginfo{id} (aliasing).\n" if ($debug);
+ print "Already have PatchSet $rev_ps for $$ginfo{id} (aliasing fetched).\n"
+ if ($debug);
+ $$ginfo{fetched}{$rev_ps} = $rev_id;
+ } elsif (defined($$visits{$rev_id})) {
+ # We obviously already have the PatchSets we have pushed ourselves,
+ # but we might have only scheduled them for visiting at this point.
+ print "Already have PatchSet $rev_ps for $$ginfo{id} (aliasing pushed).\n"
+ if ($debug);
$$ginfo{fetched}{$rev_ps} = $rev_id;
} else {
push @refs, "+$$rev{ref}:refs/gpush/g$$ginfo{key}_$rev_ps";