OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2006-2009 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 """Wrapper script around Rietveld's upload.py that groups files into | 6 """Wrapper script around Rietveld's upload.py that groups files into |
7 changelists.""" | 7 changelists.""" |
8 | 8 |
9 import getpass | 9 import getpass |
10 import os | 10 import os |
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
712 used. | 712 used. |
713 """ | 713 """ |
714 previous_cwd = os.getcwd() | 714 previous_cwd = os.getcwd() |
715 if root is None: | 715 if root is None: |
716 os.chdir(GetRepositoryRoot()) | 716 os.chdir(GetRepositoryRoot()) |
717 else: | 717 else: |
718 os.chdir(root) | 718 os.chdir(root) |
719 | 719 |
720 diff = [] | 720 diff = [] |
721 for filename in files: | 721 for filename in files: |
| 722 # TODO(maruel): Use SVN.DiffItem(). |
722 # Use svn info output instead of os.path.isdir because the latter fails | 723 # Use svn info output instead of os.path.isdir because the latter fails |
723 # when the file is deleted. | 724 # when the file is deleted. |
724 if SVN.CaptureInfo(file).get('Node Kind') == 'directory': | 725 if SVN.CaptureInfo(filename).get('Node Kind') == 'directory': |
725 continue | 726 continue |
726 # If the user specified a custom diff command in their svn config file, | 727 # If the user specified a custom diff command in their svn config file, |
727 # then it'll be used when we do svn diff, which we don't want to happen | 728 # then it'll be used when we do svn diff, which we don't want to happen |
728 # since we want the unified diff. Using --diff-cmd=diff doesn't always | 729 # since we want the unified diff. Using --diff-cmd=diff doesn't always |
729 # work, since they can have another diff executable in their path that | 730 # work, since they can have another diff executable in their path that |
730 # gives different line endings. So we use a bogus temp directory as the | 731 # gives different line endings. So we use a bogus temp directory as the |
731 # config directory, which gets around these problems. | 732 # config directory, which gets around these problems. |
732 if sys.platform.startswith("win"): | 733 if sys.platform.startswith("win"): |
733 parent_dir = tempfile.gettempdir() | 734 parent_dir = tempfile.gettempdir() |
734 else: | 735 else: |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1263 return 0 | 1264 return 0 |
1264 args =["svn", command] | 1265 args =["svn", command] |
1265 root = GetRepositoryRoot() | 1266 root = GetRepositoryRoot() |
1266 args.extend([os.path.join(root, x) for x in change_info.GetFileNames()]) | 1267 args.extend([os.path.join(root, x) for x in change_info.GetFileNames()]) |
1267 RunShell(args, True) | 1268 RunShell(args, True) |
1268 return 0 | 1269 return 0 |
1269 | 1270 |
1270 | 1271 |
1271 if __name__ == "__main__": | 1272 if __name__ == "__main__": |
1272 sys.exit(main()) | 1273 sys.exit(main()) |
OLD | NEW |