Add "git llvm revert" and "git llvm svn-lookup" subcommands
authorJordan Rupprecht <rupprecht@google.com>
Thu, 28 Mar 2019 16:15:28 +0000 (16:15 +0000)
committerJordan Rupprecht <rupprecht@google.com>
Thu, 28 Mar 2019 16:15:28 +0000 (16:15 +0000)
commite32eca041c3a70c2f099f2b2ece019196eb60539
treedfc6e7d87592f73c9a7f5d3c3c42455c147d904a
parent8b9c9822a140f083877969ae2c51ad91506e25f9
Add "git llvm revert" and "git llvm svn-lookup" subcommands

Summary:
The current git-svnrevert script only works with git-svn repos (e.g. using "git svn find-rev" to find the commit to revert). This adds a similar implementation that works with the llvm git command handler.

Usage:
```
// Revert by svn id
$ git llvm revert r123456
// See what commands would be run instead of actually reverting
$ git llvm revert -n r123456
<full git revert + git commit commands>
// Git commit hash also fine
$ git llvm revert abc123456
// For convenience, the git->svn method can be used directly:
$ git llvm svn-lookup abc123456
r123456
// Push revert upstream (drop the -n when ready)
$ git llvm push -n
```

Regardless of how the command is invoked (with a svn revision or git hash), the message is:

```
Revert [LibFoo] Change Foo implementation

This reverts r123456 (git commit abc123)
```

Reviewers: jyknight, mehdi_amini, jlebar

Reviewed By: jlebar

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D59837

llvm-svn: 357180
llvm/utils/git-svn/git-llvm