summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Sandler <dsandler@menace.cam.corp.google.com>2010-03-02 15:38:03 -0500
committerDaniel Sandler <dsandler@android.com>2010-03-04 11:56:38 -0500
commit4c50deea28badb7007fa6b78c187de50eacdd07a (patch)
treed51d267854493562a0b8a5a6480050319a78a39b
parentd63060fc9546e2132d0ad7791beb795906372e86 (diff)
downloadgit-repo-4c50deea28badb7007fa6b78c187de50eacdd07a.tar.gz
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.
-rw-r--r--project.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/project.py b/project.py
index 902a2b44..3d1783f8 100644
--- a/project.py
+++ b/project.py
@@ -706,10 +706,9 @@ class Project(object):
706 # commits are not yet merged upstream. We do not want 706 # commits are not yet merged upstream. We do not want
707 # to rewrite the published commits so we punt. 707 # to rewrite the published commits so we punt.
708 # 708 #
709 syncbuf.info(self, 709 syncbuf.fail(self,
710 "branch %s is published but is now %d commits behind", 710 "branch %s is published (but not merged) and is now %d commits behind"
711 branch.name, 711 % (branch.name, len(upstream_gain)))
712 len(upstream_gain))
713 return 712 return
714 elif pub == head: 713 elif pub == head:
715 # All published commits are merged, and thus we are a 714 # All published commits are merged, and thus we are a