OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # | 2 # |
3 # Copyright 2008 Google Inc. All Rights Reserved. | 3 # Copyright 2008 Google Inc. All Rights Reserved. |
4 # | 4 # |
5 # Licensed under the Apache License, Version 2.0 (the "License"); | 5 # Licensed under the Apache License, Version 2.0 (the "License"); |
6 # you may not use this file except in compliance with the License. | 6 # you may not use this file except in compliance with the License. |
7 # You may obtain a copy of the License at | 7 # You may obtain a copy of the License at |
8 # | 8 # |
9 # http://www.apache.org/licenses/LICENSE-2.0 | 9 # http://www.apache.org/licenses/LICENSE-2.0 |
10 # | 10 # |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 The output sent to stdout as a string. | 502 The output sent to stdout as a string. |
503 """ | 503 """ |
504 c = [SVN_COMMAND] | 504 c = [SVN_COMMAND] |
505 c.extend(args) | 505 c.extend(args) |
506 | 506 |
507 # *Sigh*: Windows needs shell=True, or else it won't search %PATH% for | 507 # *Sigh*: Windows needs shell=True, or else it won't search %PATH% for |
508 # the svn.exe executable, but shell=True makes subprocess on Linux fail | 508 # the svn.exe executable, but shell=True makes subprocess on Linux fail |
509 # when it's called with a list because it only tries to execute the | 509 # when it's called with a list because it only tries to execute the |
510 # first string ("svn"). | 510 # first string ("svn"). |
511 stderr = None | 511 stderr = None |
512 if print_error: | 512 if not print_error: |
513 stderr = subprocess.PIPE | 513 stderr = subprocess.PIPE |
514 return subprocess.Popen(c, | 514 return subprocess.Popen(c, |
515 cwd=in_directory, | 515 cwd=in_directory, |
516 shell=(sys.platform == 'win32'), | 516 shell=(sys.platform == 'win32'), |
517 stdout=subprocess.PIPE, | 517 stdout=subprocess.PIPE, |
518 stderr=stderr).communicate()[0] | 518 stderr=stderr).communicate()[0] |
519 | 519 |
520 | 520 |
521 def RunSVNAndGetFileList(args, in_directory, file_list): | 521 def RunSVNAndGetFileList(args, in_directory, file_list): |
522 """Runs svn checkout, update, or status, output to stdout. | 522 """Runs svn checkout, update, or status, output to stdout. |
(...skipping 1199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1722 | 1722 |
1723 if "__main__" == __name__: | 1723 if "__main__" == __name__: |
1724 try: | 1724 try: |
1725 result = Main(sys.argv) | 1725 result = Main(sys.argv) |
1726 except Error, e: | 1726 except Error, e: |
1727 print >> sys.stderr, "Error: %s" % str(e) | 1727 print >> sys.stderr, "Error: %s" % str(e) |
1728 result = 1 | 1728 result = 1 |
1729 sys.exit(result) | 1729 sys.exit(result) |
1730 | 1730 |
1731 # vim: ts=2:sw=2:tw=80:et: | 1731 # vim: ts=2:sw=2:tw=80:et: |
OLD | NEW |