mirror of
https://gerrit.googlesource.com/git-repo
synced 2025-01-02 16:14:25 +00:00
Fail sync when encountering "N commits behind."
This is almost always something the user needs to address before continuing work, so promoting it to a failure (rather than simply an informational message) seems the right way to go. As a side-effect, repo will now exit with a non-zero status code in this situation, so pipelines of the form `repo sync && make` will fail if there are branches that are stalled due to uploaded but unmerged patches.
This commit is contained in:
parent
d63060fc95
commit
4c50deea28
@ -706,10 +706,9 @@ class Project(object):
|
|||||||
# commits are not yet merged upstream. We do not want
|
# commits are not yet merged upstream. We do not want
|
||||||
# to rewrite the published commits so we punt.
|
# to rewrite the published commits so we punt.
|
||||||
#
|
#
|
||||||
syncbuf.info(self,
|
syncbuf.fail(self,
|
||||||
"branch %s is published but is now %d commits behind",
|
"branch %s is published (but not merged) and is now %d commits behind"
|
||||||
branch.name,
|
% (branch.name, len(upstream_gain)))
|
||||||
len(upstream_gain))
|
|
||||||
return
|
return
|
||||||
elif pub == head:
|
elif pub == head:
|
||||||
# All published commits are merged, and thus we are a
|
# All published commits are merged, and thus we are a
|
||||||
|
Loading…
Reference in New Issue
Block a user