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

Side by Side Diff: gclient_scm.py

Issue 930693002: gclient: Add '--auto_rebase' sync option. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Updated argument to have an underscore. Created 5 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 | Annotate | Revision Log
« no previous file with comments | « gclient.py ('k') | tests/gclient_scm_test.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 (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
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
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
OLDNEW
« no previous file with comments | « gclient.py ('k') | tests/gclient_scm_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698