| 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 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 del_config('branch.%s.%s' % (branch, option), scope=scope) | 367 del_config('branch.%s.%s' % (branch, option), scope=scope) |
| 368 | 368 |
| 369 | 369 |
| 370 def del_config(option, scope='local'): | 370 def del_config(option, scope='local'): |
| 371 try: | 371 try: |
| 372 run('config', '--' + scope, '--unset', option) | 372 run('config', '--' + scope, '--unset', option) |
| 373 except subprocess2.CalledProcessError: | 373 except subprocess2.CalledProcessError: |
| 374 pass | 374 pass |
| 375 | 375 |
| 376 | 376 |
| 377 def diff(oldrev, newrev, *args): |
| 378 return run('diff', oldrev, newrev, *args) |
| 379 |
| 380 |
| 377 def freeze(): | 381 def freeze(): |
| 378 took_action = False | 382 took_action = False |
| 379 | 383 |
| 380 try: | 384 try: |
| 381 run('commit', '--no-verify', '-m', FREEZE + '.indexed') | 385 run('commit', '--no-verify', '-m', FREEZE + '.indexed') |
| 382 took_action = True | 386 took_action = True |
| 383 except subprocess2.CalledProcessError: | 387 except subprocess2.CalledProcessError: |
| 384 pass | 388 pass |
| 385 | 389 |
| 386 try: | 390 try: |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 899 ['HEAD']) | 903 ['HEAD']) |
| 900 | 904 |
| 901 | 905 |
| 902 def clone_file(repository, new_workdir, link, operation): | 906 def clone_file(repository, new_workdir, link, operation): |
| 903 if not os.path.exists(os.path.join(repository, link)): | 907 if not os.path.exists(os.path.join(repository, link)): |
| 904 return | 908 return |
| 905 link_dir = os.path.dirname(os.path.join(new_workdir, link)) | 909 link_dir = os.path.dirname(os.path.join(new_workdir, link)) |
| 906 if not os.path.exists(link_dir): | 910 if not os.path.exists(link_dir): |
| 907 os.makedirs(link_dir) | 911 os.makedirs(link_dir) |
| 908 operation(os.path.join(repository, link), os.path.join(new_workdir, link)) | 912 operation(os.path.join(repository, link), os.path.join(new_workdir, link)) |
| OLD | NEW |