 Chromium Code Reviews
 Chromium Code Reviews Issue 12330131:
  Added command-line way to close issues.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
    
  
    Issue 12330131:
  Added command-line way to close issues.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master| 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 1777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1788 | 1788 | 
| 1789 | 1789 | 
| 1790 def CMDset_commit(parser, args): | 1790 def CMDset_commit(parser, args): | 
| 1791 """set the commit bit""" | 1791 """set the commit bit""" | 
| 1792 _, args = parser.parse_args(args) | 1792 _, args = parser.parse_args(args) | 
| 1793 if args: | 1793 if args: | 
| 1794 parser.error('Unrecognized args: %s' % ' '.join(args)) | 1794 parser.error('Unrecognized args: %s' % ' '.join(args)) | 
| 1795 cl = Changelist() | 1795 cl = Changelist() | 
| 1796 cl.SetFlag('commit', '1') | 1796 cl.SetFlag('commit', '1') | 
| 1797 return 0 | 1797 return 0 | 
| 1798 | 1798 | 
| 
M-A Ruel
2013/02/26 14:04:22
2 lines
 
groby-ooo-7-16
2013/02/26 15:06:55
Done.
 | |
| 1799 def CMDset_close(parser, args): | |
| 1800 """set the close bit""" | |
| 
M-A Ruel
2013/02/26 14:04:22
"""close the issue"""
 
groby-ooo-7-16
2013/02/26 15:06:55
Done.
 | |
| 1801 _, args = parser.parse_args(args) | |
| 1802 if args: | |
| 1803 parser.error('Unrecognized args: %s' % ' '.join(args)) | |
| 1804 cl = Changelist() | |
| 1805 # Ensure there actually is an issue to close. | |
| 1806 cl.GetDescription() | |
| 1807 cl.CloseIssue() | |
| 1808 return 0 | |
| 1809 | |
| 1799 | 1810 | 
| 1800 def Command(name): | 1811 def Command(name): | 
| 1801 return getattr(sys.modules[__name__], 'CMD' + name, None) | 1812 return getattr(sys.modules[__name__], 'CMD' + name, None) | 
| 1802 | 1813 | 
| 1803 | 1814 | 
| 1804 def CMDhelp(parser, args): | 1815 def CMDhelp(parser, args): | 
| 1805 """print list of commands or help for a specific command""" | 1816 """print list of commands or help for a specific command""" | 
| 1806 _, args = parser.parse_args(args) | 1817 _, args = parser.parse_args(args) | 
| 1807 if len(args) == 1: | 1818 if len(args) == 1: | 
| 1808 return main(args + ['--help']) | 1819 return main(args + ['--help']) | 
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1871 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) | 1882 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) | 
| 1872 | 1883 | 
| 1873 # Not a known command. Default to help. | 1884 # Not a known command. Default to help. | 
| 1874 GenUsage(parser, 'help') | 1885 GenUsage(parser, 'help') | 
| 1875 return CMDhelp(parser, argv) | 1886 return CMDhelp(parser, argv) | 
| 1876 | 1887 | 
| 1877 | 1888 | 
| 1878 if __name__ == '__main__': | 1889 if __name__ == '__main__': | 
| 1879 fix_encoding.fix_encoding() | 1890 fix_encoding.fix_encoding() | 
| 1880 sys.exit(main(sys.argv[1:])) | 1891 sys.exit(main(sys.argv[1:])) | 
| OLD | NEW |