Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(261)

Side by Side Diff: git_common.py

Issue 1629253002: git hyper-blame: Added approx. line number translation. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@git-hyper-blame
Patch Set: Added Caveats section to man page. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | git_hyper_blame.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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))
OLDNEW
« no previous file with comments | « no previous file | git_hyper_blame.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698