| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 # Monkeypatch IMapIterator so that Ctrl-C can kill everything properly. | 5 # Monkeypatch IMapIterator so that Ctrl-C can kill everything properly. |
| 6 # Derived from https://gist.github.com/aljungberg/626518 | 6 # Derived from https://gist.github.com/aljungberg/626518 |
| 7 import multiprocessing.pool | 7 import multiprocessing.pool |
| 8 from multiprocessing.pool import IMapIterator | 8 from multiprocessing.pool import IMapIterator |
| 9 def wrapper(func): | 9 def wrapper(func): |
| 10 def wrap(self, timeout=None): | 10 def wrap(self, timeout=None): |
| (...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1000 GIT_DIRECTORY_WHITELIST = [ | 1000 GIT_DIRECTORY_WHITELIST = [ |
| 1001 'config', | 1001 'config', |
| 1002 'info', | 1002 'info', |
| 1003 'hooks', | 1003 'hooks', |
| 1004 'logs/refs', | 1004 'logs/refs', |
| 1005 'objects', | 1005 'objects', |
| 1006 'packed-refs', | 1006 'packed-refs', |
| 1007 'refs', | 1007 'refs', |
| 1008 'remotes', | 1008 'remotes', |
| 1009 'rr-cache', | 1009 'rr-cache', |
| 1010 'svn' | |
| 1011 ] | 1010 ] |
| 1012 make_workdir_common(repository, new_workdir, GIT_DIRECTORY_WHITELIST, | 1011 make_workdir_common(repository, new_workdir, GIT_DIRECTORY_WHITELIST, |
| 1013 ['HEAD']) | 1012 ['HEAD']) |
| 1014 | 1013 |
| 1015 | 1014 |
| 1016 def clone_file(repository, new_workdir, link, operation): | 1015 def clone_file(repository, new_workdir, link, operation): |
| 1017 if not os.path.exists(os.path.join(repository, link)): | 1016 if not os.path.exists(os.path.join(repository, link)): |
| 1018 return | 1017 return |
| 1019 link_dir = os.path.dirname(os.path.join(new_workdir, link)) | 1018 link_dir = os.path.dirname(os.path.join(new_workdir, link)) |
| 1020 if not os.path.exists(link_dir): | 1019 if not os.path.exists(link_dir): |
| 1021 os.makedirs(link_dir) | 1020 os.makedirs(link_dir) |
| 1022 operation(os.path.join(repository, link), os.path.join(new_workdir, link)) | 1021 operation(os.path.join(repository, link), os.path.join(new_workdir, link)) |
| OLD | NEW |