OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 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 logging | 10 import logging |
(...skipping 1284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1295 print "Patch applied to index." | 1295 print "Patch applied to index." |
1296 return 0 | 1296 return 0 |
1297 | 1297 |
1298 | 1298 |
1299 def CMDrebase(parser, args): | 1299 def CMDrebase(parser, args): |
1300 """rebase current branch on top of svn repo""" | 1300 """rebase current branch on top of svn repo""" |
1301 # Provide a wrapper for git svn rebase to help avoid accidental | 1301 # Provide a wrapper for git svn rebase to help avoid accidental |
1302 # git svn dcommit. | 1302 # git svn dcommit. |
1303 # It's the only command that doesn't use parser at all since we just defer | 1303 # It's the only command that doesn't use parser at all since we just defer |
1304 # execution to git-svn. | 1304 # execution to git-svn. |
1305 subprocess2.check_call(['git', 'svn', 'rebase'] + args) | 1305 return subprocess2.call(['git', 'svn', 'rebase'] + args) |
1306 return 0 | |
1307 | 1306 |
1308 | 1307 |
1309 def GetTreeStatus(): | 1308 def GetTreeStatus(): |
1310 """Fetches the tree status and returns either 'open', 'closed', | 1309 """Fetches the tree status and returns either 'open', 'closed', |
1311 'unknown' or 'unset'.""" | 1310 'unknown' or 'unset'.""" |
1312 url = settings.GetTreeStatusUrl(error_ok=True) | 1311 url = settings.GetTreeStatusUrl(error_ok=True) |
1313 if url: | 1312 if url: |
1314 status = urllib2.urlopen(url).read().lower() | 1313 status = urllib2.urlopen(url).read().lower() |
1315 if status.find('closed') != -1 or status == '0': | 1314 if status.find('closed') != -1 or status == '0': |
1316 return 'closed' | 1315 return 'closed' |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1432 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) | 1431 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) |
1433 | 1432 |
1434 # Not a known command. Default to help. | 1433 # Not a known command. Default to help. |
1435 GenUsage(parser, 'help') | 1434 GenUsage(parser, 'help') |
1436 return CMDhelp(parser, argv) | 1435 return CMDhelp(parser, argv) |
1437 | 1436 |
1438 | 1437 |
1439 if __name__ == '__main__': | 1438 if __name__ == '__main__': |
1440 fix_encoding.fix_encoding() | 1439 fix_encoding.fix_encoding() |
1441 sys.exit(main(sys.argv[1:])) | 1440 sys.exit(main(sys.argv[1:])) |
OLD | NEW |