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 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
649 if log_msg: | 649 if log_msg: |
650 log_msg += '\n' | 650 log_msg += '\n' |
651 log_msg += run('log', '--reverse', '--format=%H%n%B', '%s..HEAD' % merge_base) | 651 log_msg += run('log', '--reverse', '--format=%H%n%B', '%s..HEAD' % merge_base) |
652 run('reset', '--soft', merge_base) | 652 run('reset', '--soft', merge_base) |
653 | 653 |
654 if not get_dirty_files(): | 654 if not get_dirty_files(): |
655 # Sometimes the squash can result in the same tree, meaning that there is | 655 # Sometimes the squash can result in the same tree, meaning that there is |
656 # nothing to commit at this point. | 656 # nothing to commit at this point. |
657 print 'Nothing to commit; squashed branch is empty' | 657 print 'Nothing to commit; squashed branch is empty' |
658 return False | 658 return False |
659 run('commit', '-a', '-F', '-', indata=log_msg) | 659 run('commit', '--no-verify', '-a', '-F', '-', indata=log_msg) |
660 return True | 660 return True |
661 | 661 |
662 | 662 |
663 def tags(*args): | 663 def tags(*args): |
664 return run('tag', *args).splitlines() | 664 return run('tag', *args).splitlines() |
665 | 665 |
666 | 666 |
667 def thaw(): | 667 def thaw(): |
668 took_action = False | 668 took_action = False |
669 for sha in (s.strip() for s in run_stream('rev-list', 'HEAD').xreadlines()): | 669 for sha in (s.strip() for s in run_stream('rev-list', 'HEAD').xreadlines()): |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
809 hash=branch_hash, upstream=upstream_branch, ahead=ahead, behind=behind) | 809 hash=branch_hash, upstream=upstream_branch, ahead=ahead, behind=behind) |
810 | 810 |
811 # Set None for upstreams which are not branches (e.g empty upstream, remotes | 811 # Set None for upstreams which are not branches (e.g empty upstream, remotes |
812 # and deleted upstream branches). | 812 # and deleted upstream branches). |
813 missing_upstreams = {} | 813 missing_upstreams = {} |
814 for info in info_map.values(): | 814 for info in info_map.values(): |
815 if info.upstream not in info_map and info.upstream not in missing_upstreams: | 815 if info.upstream not in info_map and info.upstream not in missing_upstreams: |
816 missing_upstreams[info.upstream] = None | 816 missing_upstreams[info.upstream] = None |
817 | 817 |
818 return dict(info_map.items() + missing_upstreams.items()) | 818 return dict(info_map.items() + missing_upstreams.items()) |
OLD | NEW |