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 import logging | 7 import logging |
8 import os | 8 import os |
9 import posixpath | 9 import posixpath |
10 import re | 10 import re |
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 | 533 |
534 default_rev = "refs/heads/master" | 534 default_rev = "refs/heads/master" |
535 _, deps_revision = gclient_utils.SplitUrlRevision(self.url) | 535 _, deps_revision = gclient_utils.SplitUrlRevision(self.url) |
536 if not deps_revision: | 536 if not deps_revision: |
537 deps_revision = default_rev | 537 deps_revision = default_rev |
538 if deps_revision.startswith('refs/heads/'): | 538 if deps_revision.startswith('refs/heads/'): |
539 deps_revision = deps_revision.replace('refs/heads/', 'origin/') | 539 deps_revision = deps_revision.replace('refs/heads/', 'origin/') |
540 | 540 |
541 files = self._Capture(['diff', deps_revision, '--name-only']).split() | 541 files = self._Capture(['diff', deps_revision, '--name-only']).split() |
542 self._Run(['reset', '--hard', deps_revision], options) | 542 self._Run(['reset', '--hard', deps_revision], options) |
| 543 self._Run(['clean', '-f', '-d'], options) |
543 file_list.extend([os.path.join(self.checkout_path, f) for f in files]) | 544 file_list.extend([os.path.join(self.checkout_path, f) for f in files]) |
544 | 545 |
545 def revinfo(self, options, args, file_list): | 546 def revinfo(self, options, args, file_list): |
546 """Returns revision""" | 547 """Returns revision""" |
547 return self._Capture(['rev-parse', 'HEAD']) | 548 return self._Capture(['rev-parse', 'HEAD']) |
548 | 549 |
549 def runhooks(self, options, args, file_list): | 550 def runhooks(self, options, args, file_list): |
550 self.status(options, args, file_list) | 551 self.status(options, args, file_list) |
551 | 552 |
552 def status(self, options, args, file_list): | 553 def status(self, options, args, file_list): |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1199 new_command.append('--force') | 1200 new_command.append('--force') |
1200 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1201 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1201 new_command.extend(('--accept', 'theirs-conflict')) | 1202 new_command.extend(('--accept', 'theirs-conflict')) |
1202 elif options.manually_grab_svn_rev: | 1203 elif options.manually_grab_svn_rev: |
1203 new_command.append('--force') | 1204 new_command.append('--force') |
1204 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1205 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1205 new_command.extend(('--accept', 'postpone')) | 1206 new_command.extend(('--accept', 'postpone')) |
1206 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1207 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1207 new_command.extend(('--accept', 'postpone')) | 1208 new_command.extend(('--accept', 'postpone')) |
1208 return new_command | 1209 return new_command |
OLD | NEW |