OLD | NEW |
1 # Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2009 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 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
799 scm.SVN.RunAndGetFileList(options, ['update', '--revision', 'BASE'], path, | 799 scm.SVN.RunAndGetFileList(options, ['update', '--revision', 'BASE'], path, |
800 file_list) | 800 file_list) |
801 except OSError, e: | 801 except OSError, e: |
802 # Maybe the directory disapeared meanwhile. We don't want it to throw an | 802 # Maybe the directory disapeared meanwhile. We don't want it to throw an |
803 # exception. | 803 # exception. |
804 logging.error('Failed to update:\n%s' % str(e)) | 804 logging.error('Failed to update:\n%s' % str(e)) |
805 | 805 |
806 def revinfo(self, options, args, file_list): | 806 def revinfo(self, options, args, file_list): |
807 """Display revision""" | 807 """Display revision""" |
808 __pychecker__ = 'unusednames=args,file_list,options' | 808 __pychecker__ = 'unusednames=args,file_list,options' |
809 return scm.SVN.CaptureHeadRevision(self.url) | 809 return scm.SVN.CaptureBaseRevision(self.checkout_path) |
810 | 810 |
811 def runhooks(self, options, args, file_list): | 811 def runhooks(self, options, args, file_list): |
812 self.status(options, args, file_list) | 812 self.status(options, args, file_list) |
813 | 813 |
814 def status(self, options, args, file_list): | 814 def status(self, options, args, file_list): |
815 """Display status information.""" | 815 """Display status information.""" |
816 path = os.path.join(self._root_dir, self.relpath) | 816 path = os.path.join(self._root_dir, self.relpath) |
817 command = ['status'] | 817 command = ['status'] |
818 command.extend(args) | 818 command.extend(args) |
819 if not os.path.isdir(path): | 819 if not os.path.isdir(path): |
820 # svn status won't work if the directory doesn't exist. | 820 # svn status won't work if the directory doesn't exist. |
821 print("\n________ couldn't run \'%s\' in \'%s\':\nThe directory " | 821 print("\n________ couldn't run \'%s\' in \'%s\':\nThe directory " |
822 "does not exist." | 822 "does not exist." |
823 % (' '.join(command), path)) | 823 % (' '.join(command), path)) |
824 # There's no file list to retrieve. | 824 # There's no file list to retrieve. |
825 else: | 825 else: |
826 scm.SVN.RunAndGetFileList(options, command, path, file_list) | 826 scm.SVN.RunAndGetFileList(options, command, path, file_list) |
827 | 827 |
828 def FullUrlForRelativeUrl(self, url): | 828 def FullUrlForRelativeUrl(self, url): |
829 # Find the forth '/' and strip from there. A bit hackish. | 829 # Find the forth '/' and strip from there. A bit hackish. |
830 return '/'.join(self.url.split('/')[:4]) + url | 830 return '/'.join(self.url.split('/')[:4]) + url |
OLD | NEW |