OLD | NEW |
1 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2010 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 import logging | 7 import logging |
8 import os | 8 import os |
9 import posixpath | 9 import posixpath |
10 import re | 10 import re |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 "Please merge or rebase manually:\n" + | 348 "Please merge or rebase manually:\n" + |
349 "cd %s; git rebase %s\n" % (self.checkout_path, new_base) + | 349 "cd %s; git rebase %s\n" % (self.checkout_path, new_base) + |
350 "OR git checkout -b <some new branch> %s" % new_base) | 350 "OR git checkout -b <some new branch> %s" % new_base) |
351 raise gclient_utils.Error(switch_error) | 351 raise gclient_utils.Error(switch_error) |
352 else: | 352 else: |
353 # case 3 - the default case | 353 # case 3 - the default case |
354 files = self._Capture(['diff', upstream_branch, '--name-only']).split() | 354 files = self._Capture(['diff', upstream_branch, '--name-only']).split() |
355 if verbose: | 355 if verbose: |
356 print('Trying fast-forward merge to branch : %s' % upstream_branch) | 356 print('Trying fast-forward merge to branch : %s' % upstream_branch) |
357 try: | 357 try: |
358 merge_output = scm.GIT.Capture(['merge', '--ff-only', upstream_branch], | 358 merge_args = ['merge'] |
359 cwd=self.checkout_path) | 359 if not options.merge: |
| 360 merge_args.append('--ff-only') |
| 361 merge_args.append(upstream_branch) |
| 362 merge_output = scm.GIT.Capture(merge_args, cwd=self.checkout_path) |
360 except gclient_utils.CheckCallError, e: | 363 except gclient_utils.CheckCallError, e: |
361 if re.match('fatal: Not possible to fast-forward, aborting.', e.stderr): | 364 if re.match('fatal: Not possible to fast-forward, aborting.', e.stderr): |
362 if not printed_path: | 365 if not printed_path: |
363 print('\n_____ %s%s' % (self.relpath, rev_str)) | 366 print('\n_____ %s%s' % (self.relpath, rev_str)) |
364 printed_path = True | 367 printed_path = True |
365 while True: | 368 while True: |
366 try: | 369 try: |
367 # TODO(maruel): That can't work with --jobs. | 370 # TODO(maruel): That can't work with --jobs. |
368 action = ask_for_data( | 371 action = ask_for_data( |
369 'Cannot fast-forward merge, attempt to rebase? ' | 372 'Cannot fast-forward merge, attempt to rebase? ' |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
937 | 940 |
938 This method returns a new list to be used as a command.""" | 941 This method returns a new list to be used as a command.""" |
939 new_command = command[:] | 942 new_command = command[:] |
940 if revision: | 943 if revision: |
941 new_command.extend(['--revision', str(revision).strip()]) | 944 new_command.extend(['--revision', str(revision).strip()]) |
942 # --force was added to 'svn update' in svn 1.5. | 945 # --force was added to 'svn update' in svn 1.5. |
943 if ((options.force or options.manually_grab_svn_rev) and | 946 if ((options.force or options.manually_grab_svn_rev) and |
944 scm.SVN.AssertVersion("1.5")[0]): | 947 scm.SVN.AssertVersion("1.5")[0]): |
945 new_command.append('--force') | 948 new_command.append('--force') |
946 return new_command | 949 return new_command |
OLD | NEW |