OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 """Gclient-specific SCM-specific operations.""" | 5 """Gclient-specific SCM-specific operations.""" |
6 | 6 |
7 from __future__ import print_function | 7 from __future__ import print_function |
8 | 8 |
9 import errno | 9 import errno |
10 import logging | 10 import logging |
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
585 merge_args.append('--ff-only') | 585 merge_args.append('--ff-only') |
586 merge_args.append(upstream_branch) | 586 merge_args.append(upstream_branch) |
587 merge_output = self._Capture(merge_args) | 587 merge_output = self._Capture(merge_args) |
588 except subprocess2.CalledProcessError as e: | 588 except subprocess2.CalledProcessError as e: |
589 if re.match('fatal: Not possible to fast-forward, aborting.', e.stderr): | 589 if re.match('fatal: Not possible to fast-forward, aborting.', e.stderr): |
590 files = [] | 590 files = [] |
591 if not printed_path: | 591 if not printed_path: |
592 self.Print('_____ %s%s' % (self.relpath, rev_str), timestamp=False) | 592 self.Print('_____ %s%s' % (self.relpath, rev_str), timestamp=False) |
593 printed_path = True | 593 printed_path = True |
594 while True: | 594 while True: |
595 try: | 595 if not options.auto_rebase: |
596 action = self._AskForData( | 596 try: |
597 'Cannot %s, attempt to rebase? ' | 597 action = self._AskForData( |
598 '(y)es / (q)uit / (s)kip : ' % | 598 'Cannot %s, attempt to rebase? ' |
599 ('merge' if options.merge else 'fast-forward merge'), | 599 '(y)es / (q)uit / (s)kip : ' % |
600 options) | 600 ('merge' if options.merge else 'fast-forward merge'), |
601 except ValueError: | 601 options) |
602 raise gclient_utils.Error('Invalid Character') | 602 except ValueError: |
603 if re.match(r'yes|y', action, re.I): | 603 raise gclient_utils.Error('Invalid Character') |
| 604 if options.auto_rebase or re.match(r'yes|y', action, re.I): |
604 self._AttemptRebase(upstream_branch, files, options, | 605 self._AttemptRebase(upstream_branch, files, options, |
605 printed_path=printed_path, merge=False) | 606 printed_path=printed_path, merge=False) |
606 printed_path = True | 607 printed_path = True |
607 break | 608 break |
608 elif re.match(r'quit|q', action, re.I): | 609 elif re.match(r'quit|q', action, re.I): |
609 raise gclient_utils.Error("Can't fast-forward, please merge or " | 610 raise gclient_utils.Error("Can't fast-forward, please merge or " |
610 "rebase manually.\n" | 611 "rebase manually.\n" |
611 "cd %s && git " % self.checkout_path | 612 "cd %s && git " % self.checkout_path |
612 + "rebase %s" % upstream_branch) | 613 + "rebase %s" % upstream_branch) |
613 elif re.match(r'skip|s', action, re.I): | 614 elif re.match(r'skip|s', action, re.I): |
(...skipping 988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1602 new_command.append('--force') | 1603 new_command.append('--force') |
1603 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1604 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1604 new_command.extend(('--accept', 'theirs-conflict')) | 1605 new_command.extend(('--accept', 'theirs-conflict')) |
1605 elif options.manually_grab_svn_rev: | 1606 elif options.manually_grab_svn_rev: |
1606 new_command.append('--force') | 1607 new_command.append('--force') |
1607 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1608 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1608 new_command.extend(('--accept', 'postpone')) | 1609 new_command.extend(('--accept', 'postpone')) |
1609 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1610 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1610 new_command.extend(('--accept', 'postpone')) | 1611 new_command.extend(('--accept', 'postpone')) |
1611 return new_command | 1612 return new_command |
OLD | NEW |