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

Side by Side Diff: git_common.py

Issue 1350043002: Fix git-freeze when using a commit hook which could reject a commit. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 5 years, 3 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 | no next file » | 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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 try: 350 try:
351 run('config', '--' + scope, '--unset', option) 351 run('config', '--' + scope, '--unset', option)
352 except subprocess2.CalledProcessError: 352 except subprocess2.CalledProcessError:
353 pass 353 pass
354 354
355 355
356 def freeze(): 356 def freeze():
357 took_action = False 357 took_action = False
358 358
359 try: 359 try:
360 run('commit', '-m', FREEZE + '.indexed') 360 run('commit', '--no-verify', '-m', FREEZE + '.indexed')
361 took_action = True 361 took_action = True
362 except subprocess2.CalledProcessError: 362 except subprocess2.CalledProcessError:
363 pass 363 pass
364 364
365 try: 365 try:
366 run('add', '-A') 366 run('add', '-A')
367 run('commit', '-m', FREEZE + '.unindexed') 367 run('commit', '--no-verify', '-m', FREEZE + '.unindexed')
368 took_action = True 368 took_action = True
369 except subprocess2.CalledProcessError: 369 except subprocess2.CalledProcessError:
370 pass 370 pass
371 371
372 if not took_action: 372 if not took_action:
373 return 'Nothing to freeze.' 373 return 'Nothing to freeze.'
374 374
375 375
376 def get_branch_tree(): 376 def get_branch_tree():
377 """Get the dictionary of {branch: parent}, compatible with topo_iter. 377 """Get the dictionary of {branch: parent}, compatible with topo_iter.
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 hash=branch_hash, upstream=upstream_branch, ahead=ahead, behind=behind) 810 hash=branch_hash, upstream=upstream_branch, ahead=ahead, behind=behind)
811 811
812 # Set None for upstreams which are not branches (e.g empty upstream, remotes 812 # Set None for upstreams which are not branches (e.g empty upstream, remotes
813 # and deleted upstream branches). 813 # and deleted upstream branches).
814 missing_upstreams = {} 814 missing_upstreams = {}
815 for info in info_map.values(): 815 for info in info_map.values():
816 if info.upstream not in info_map and info.upstream not in missing_upstreams: 816 if info.upstream not in info_map and info.upstream not in missing_upstreams:
817 missing_upstreams[info.upstream] = None 817 missing_upstreams[info.upstream] = None
818 818
819 return dict(info_map.items() + missing_upstreams.items()) 819 return dict(info_map.items() + missing_upstreams.items())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698