OLD | NEW |
1 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """SCM-specific utility classes.""" | 5 """SCM-specific utility classes.""" |
6 | 6 |
7 import glob | 7 import glob |
8 import os | 8 import os |
9 import re | 9 import re |
10 import shutil | 10 import shutil |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 print_messages, | 94 print_messages, |
95 print_stdout, | 95 print_stdout, |
96 filter): | 96 filter): |
97 """Runs a command, optionally outputting to stdout. | 97 """Runs a command, optionally outputting to stdout. |
98 | 98 |
99 stdout is passed line-by-line to the given filter function. If | 99 stdout is passed line-by-line to the given filter function. If |
100 print_stdout is true, it is also printed to sys.stdout as in Run. | 100 print_stdout is true, it is also printed to sys.stdout as in Run. |
101 | 101 |
102 Args: | 102 Args: |
103 args: A sequence of command line parameters to be passed. | 103 args: A sequence of command line parameters to be passed. |
104 in_directory: The directory where svn is to be run. | 104 in_directory: The directory where git is to be run. |
105 print_messages: Whether to print status messages to stdout about | 105 print_messages: Whether to print status messages to stdout about |
106 which commands are being run. | 106 which commands are being run. |
107 print_stdout: Whether to forward program's output to stdout. | 107 print_stdout: Whether to forward program's output to stdout. |
108 filter: A function taking one argument (a string) which will be | 108 filter: A function taking one argument (a string) which will be |
109 passed each line (with the ending newline character removed) of | 109 passed each line (with the ending newline character removed) of |
110 program's output for filtering. | 110 program's output for filtering. |
111 | 111 |
112 Raises: | 112 Raises: |
113 gclient_utils.Error: An error occurred while running the command. | 113 gclient_utils.Error: An error occurred while running the command. |
114 """ | 114 """ |
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
735 if not cur_dir_repo_root: | 735 if not cur_dir_repo_root: |
736 return None | 736 return None |
737 | 737 |
738 while True: | 738 while True: |
739 parent = os.path.dirname(directory) | 739 parent = os.path.dirname(directory) |
740 if (SVN.CaptureInfo(parent, print_error=False).get( | 740 if (SVN.CaptureInfo(parent, print_error=False).get( |
741 "Repository Root") != cur_dir_repo_root): | 741 "Repository Root") != cur_dir_repo_root): |
742 break | 742 break |
743 directory = parent | 743 directory = parent |
744 return GetCasedPath(directory) | 744 return GetCasedPath(directory) |
OLD | NEW |