diff options
author | Erwan Mahe <erwan.mahe@intel.com> | 2011-08-19 13:56:09 +0200 |
---|---|---|
committer | Shawn O. Pearce <sop@google.com> | 2012-05-24 09:03:10 -0700 |
commit | a94f162b9fe85389f3e1c9555628d9229105e15d (patch) | |
tree | da3852d6ede787a8d1974cddab3db8c98e4fc39e /project.py | |
parent | e5a2122e6429b5eee861807e7050eb02045a7d4f (diff) | |
download | git-repo-a94f162b9fe85389f3e1c9555628d9229105e15d.tar.gz |
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 <erwan.mahe@intel.com>
Signed-off-by: Pierre Tardy <pierre.tardy@intel.com>
Diffstat (limited to 'project.py')
-rw-r--r-- | project.py | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -1645,6 +1645,15 @@ class Project(object): | |||
1645 | if self._allrefs: | 1645 | if self._allrefs: |
1646 | raise GitError('%s cherry-pick %s ' % (self.name, rev)) | 1646 | raise GitError('%s cherry-pick %s ' % (self.name, rev)) |
1647 | 1647 | ||
1648 | def _Revert(self, rev, quiet=False): | ||
1649 | cmd = ['revert'] | ||
1650 | cmd.append('--no-edit') | ||
1651 | cmd.append(rev) | ||
1652 | cmd.append('--') | ||
1653 | if GitCommand(self, cmd).Wait() != 0: | ||
1654 | if self._allrefs: | ||
1655 | raise GitError('%s revert %s ' % (self.name, rev)) | ||
1656 | |||
1648 | def _ResetHard(self, rev, quiet=True): | 1657 | def _ResetHard(self, rev, quiet=True): |
1649 | cmd = ['reset', '--hard'] | 1658 | cmd = ['reset', '--hard'] |
1650 | if quiet: | 1659 | if quiet: |