OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 # Copyright (C) 2008 Evan Martin <martine@danga.com> | 6 # Copyright (C) 2008 Evan Martin <martine@danga.com> |
7 | 7 |
8 """A git-command for integrating reviews on Rietveld.""" | 8 """A git-command for integrating reviews on Rietveld.""" |
9 | 9 |
10 import json | 10 import json |
(...skipping 1617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1628 subprocess2.check_call(cmd, stdin=patch_data, stdout=subprocess2.VOID) | 1628 subprocess2.check_call(cmd, stdin=patch_data, stdout=subprocess2.VOID) |
1629 except subprocess2.CalledProcessError: | 1629 except subprocess2.CalledProcessError: |
1630 DieWithError('Failed to apply the patch') | 1630 DieWithError('Failed to apply the patch') |
1631 | 1631 |
1632 # If we had an issue, commit the current state and register the issue. | 1632 # If we had an issue, commit the current state and register the issue. |
1633 if not options.nocommit: | 1633 if not options.nocommit: |
1634 RunGit(['commit', '-m', 'patch from issue %s' % issue]) | 1634 RunGit(['commit', '-m', 'patch from issue %s' % issue]) |
1635 cl = Changelist() | 1635 cl = Changelist() |
1636 cl.SetIssue(issue) | 1636 cl.SetIssue(issue) |
1637 cl.SetPatchset(patchset) | 1637 cl.SetPatchset(patchset) |
1638 print "Committed patch." | 1638 print "Committed patch locally." |
1639 else: | 1639 else: |
1640 print "Patch applied to index." | 1640 print "Patch applied to index." |
1641 return 0 | 1641 return 0 |
1642 | 1642 |
1643 | 1643 |
1644 def CMDrebase(parser, args): | 1644 def CMDrebase(parser, args): |
1645 """rebase current branch on top of svn repo""" | 1645 """rebase current branch on top of svn repo""" |
1646 # Provide a wrapper for git svn rebase to help avoid accidental | 1646 # Provide a wrapper for git svn rebase to help avoid accidental |
1647 # git svn dcommit. | 1647 # git svn dcommit. |
1648 # It's the only command that doesn't use parser at all since we just defer | 1648 # It's the only command that doesn't use parser at all since we just defer |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1905 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) | 1905 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) |
1906 | 1906 |
1907 # Not a known command. Default to help. | 1907 # Not a known command. Default to help. |
1908 GenUsage(parser, 'help') | 1908 GenUsage(parser, 'help') |
1909 return CMDhelp(parser, argv) | 1909 return CMDhelp(parser, argv) |
1910 | 1910 |
1911 | 1911 |
1912 if __name__ == '__main__': | 1912 if __name__ == '__main__': |
1913 fix_encoding.fix_encoding() | 1913 fix_encoding.fix_encoding() |
1914 sys.exit(main(sys.argv[1:])) | 1914 sys.exit(main(sys.argv[1:])) |
OLD | NEW |