From 3d125940f6223efe62e35b795f57e7e717b4528e Mon Sep 17 00:00:00 2001 From: Pierre Tardy Date: Fri, 4 May 2012 12:18:12 +0200 Subject: repo download: add --ff-only option Allows to ff-only a gerrit patch This patch is necessary to automatically ensure that the patch will be correctly submitted on ff-only gerrit projects You can now use: repo download (--ff-only|-f) project changeid/patchnumber This is useful to automate verification of fast forward status of a patch in the context of build automation, and commit gating (e.g. buildbot) Change-Id: I403a667557a105411a633e62c8eec23d93724b43 Signed-off-by: Erwan Mahe Signed-off-by: Pierre Tardy --- project.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'project.py') diff --git a/project.py b/project.py index 1b0769a6..65fefd92 100644 --- a/project.py +++ b/project.py @@ -1670,8 +1670,10 @@ class Project(object): if GitCommand(self, cmd).Wait() != 0: raise GitError('%s rebase %s ' % (self.name, upstream)) - def _FastForward(self, head): + def _FastForward(self, head, ffonly=False): cmd = ['merge', head] + if ffonly: + cmd.append("--ff-only") if GitCommand(self, cmd).Wait() != 0: raise GitError('%s merge %s ' % (self.name, head)) -- cgit v1.2.3-54-g00ecf