From a94f162b9fe85389f3e1c9555628d9229105e15d Mon Sep 17 00:00:00 2001 From: Erwan Mahe Date: Fri, 19 Aug 2011 13:56:09 +0200 Subject: repo download: add --revert option BZ: 4779 Allows to revert a gerrit patch This patch is necessary for the on-demand creation of engineering builds using buildbot You can now use: repo download [--revert|-r project changeid/patchnumber This is useful to automate reverting of a patch in the context of build automation, and regression bisection Change-Id: I3985e80e4b2a230f83526191ea1379765a54bdcf Signed-off-by: Erwan Mahe Signed-off-by: Pierre Tardy --- project.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'project.py') diff --git a/project.py b/project.py index 49da34a8..1b0769a6 100644 --- a/project.py +++ b/project.py @@ -1645,6 +1645,15 @@ class Project(object): if self._allrefs: raise GitError('%s cherry-pick %s ' % (self.name, rev)) + def _Revert(self, rev, quiet=False): + cmd = ['revert'] + cmd.append('--no-edit') + cmd.append(rev) + cmd.append('--') + if GitCommand(self, cmd).Wait() != 0: + if self._allrefs: + raise GitError('%s revert %s ' % (self.name, rev)) + def _ResetHard(self, rev, quiet=True): cmd = ['reset', '--hard'] if quiet: -- cgit v1.2.3-54-g00ecf