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 """ | 6 """ |
7 lastchange.py -- Chromium revision fetching utility. | 7 lastchange.py -- Chromium revision fetching utility. |
8 """ | 8 """ |
9 | 9 |
10 import re | 10 import re |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 | 110 |
111 Returns: | 111 Returns: |
112 whether git-svn has been set up. | 112 whether git-svn has been set up. |
113 """ | 113 """ |
114 # To test whether git-svn has been set up, query the config for any | 114 # To test whether git-svn has been set up, query the config for any |
115 # svn-related configuration. This command exits with an error code | 115 # svn-related configuration. This command exits with an error code |
116 # if there aren't any matches, so ignore its output. | 116 # if there aren't any matches, so ignore its output. |
117 proc = RunGitCommand(directory, ['config', '--get-regexp', '^svn']) | 117 proc = RunGitCommand(directory, ['config', '--get-regexp', '^svn']) |
118 if proc: | 118 if proc: |
119 return (proc.wait() == 0) | 119 return (proc.wait() == 0) |
120 return false | 120 return False |
121 | 121 |
122 | 122 |
123 def FetchGitSVNURL(directory): | 123 def FetchGitSVNURL(directory): |
124 """ | 124 """ |
125 Fetch URL of SVN repository bound to git. | 125 Fetch URL of SVN repository bound to git. |
126 | 126 |
127 Errors are swallowed. | 127 Errors are swallowed. |
128 | 128 |
129 Returns: | 129 Returns: |
130 SVN URL. | 130 SVN URL. |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 if out_file: | 251 if out_file: |
252 WriteIfChanged(out_file, contents) | 252 WriteIfChanged(out_file, contents) |
253 else: | 253 else: |
254 sys.stdout.write(contents) | 254 sys.stdout.write(contents) |
255 | 255 |
256 return 0 | 256 return 0 |
257 | 257 |
258 | 258 |
259 if __name__ == '__main__': | 259 if __name__ == '__main__': |
260 sys.exit(main()) | 260 sys.exit(main()) |
OLD | NEW |