| OLD | NEW |
| 1 # Copyright 2009 Google Inc. All Rights Reserved. | 1 # Copyright 2009 Google Inc. All Rights Reserved. |
| 2 # | 2 # |
| 3 # Licensed under the Apache License, Version 2.0 (the "License"); | 3 # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 # you may not use this file except in compliance with the License. | 4 # you may not use this file except in compliance with the License. |
| 5 # You may obtain a copy of the License at | 5 # You may obtain a copy of the License at |
| 6 # | 6 # |
| 7 # http://www.apache.org/licenses/LICENSE-2.0 | 7 # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 # | 8 # |
| 9 # Unless required by applicable law or agreed to in writing, software | 9 # Unless required by applicable law or agreed to in writing, software |
| 10 # distributed under the License is distributed on an "AS IS" BASIS, | 10 # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 # See the License for the specific language governing permissions and | 12 # See the License for the specific language governing permissions and |
| 13 # limitations under the License. | 13 # limitations under the License. |
| 14 | 14 |
| 15 import os | 15 import os |
| 16 import stat |
| 16 import subprocess | 17 import subprocess |
| 17 import sys | 18 import sys |
| 18 import xml.dom.minidom | 19 import xml.dom.minidom |
| 19 | 20 |
| 20 ## Generic utils | 21 ## Generic utils |
| 21 | 22 |
| 22 | 23 |
| 23 def ParseXML(output): | 24 def ParseXML(output): |
| 24 try: | 25 try: |
| 25 return xml.dom.minidom.parseString(output) | 26 return xml.dom.minidom.parseString(output) |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 raise Error(msg) | 231 raise Error(msg) |
| 231 | 232 |
| 232 | 233 |
| 233 def IsUsingGit(root, paths): | 234 def IsUsingGit(root, paths): |
| 234 """Returns True if we're using git to manage any of our checkouts. | 235 """Returns True if we're using git to manage any of our checkouts. |
| 235 |entries| is a list of paths to check.""" | 236 |entries| is a list of paths to check.""" |
| 236 for path in paths: | 237 for path in paths: |
| 237 if os.path.exists(os.path.join(root, path, '.git')): | 238 if os.path.exists(os.path.join(root, path, '.git')): |
| 238 return True | 239 return True |
| 239 return False | 240 return False |
| OLD | NEW |