Chromium Code Reviews| Index: git_tools.py |
| diff --git a/git_tools.py b/git_tools.py |
| index 5f52f9e593dc68ebadd6c988c056582c45e69af5..da5b957eb63b7615ae276759c84058018f3ff489 100755 |
| --- a/git_tools.py |
| +++ b/git_tools.py |
| @@ -149,14 +149,16 @@ def Clone(git_url, git_repo, is_mirror, out_buffer=None): |
| return Git(None, cmd, is_mirror=is_mirror, out_buffer=out_buffer) |
| -def PopulateCache(git_url, shallow=False): |
| +def PopulateCache(git_url, shallow=False, print_fn=None): |
| # --shallow by default checks out 10000 revision, but for really large |
| # repos like adobe ones, we want significantly less than 10000. |
| depth = None |
| if shallow and 'adobe' in git_url: |
| depth = 10 |
| - mirror = git_cache.Mirror(git_url, print_func=lambda *args: None) |
| - mirror.populate(depth=depth, shallow=shallow, ignore_lock=True) |
| + print_fn = print_fn or (lambda *args: None) |
|
szager1
2014/10/08 20:58:09
Not sure about this; it will bury errors.
Ryan Tseng
2014/10/08 21:00:35
Should I make print_fn required instead?
ie. asse
szager1
2014/10/08 23:38:46
Just pass print_fn through; if it's None, the git_
Ryan Tseng
2014/10/08 23:41:59
Done.
|
| + mirror = git_cache.Mirror(git_url, print_func=print_fn) |
| + mirror.populate(depth=depth, shallow=shallow, bootstrap=True, |
| + verbose=True, ignore_lock=True) |
| return mirror.mirror_path |