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

Side by Side Diff: gclient_scm.py

Issue 1307001: revinfo: Properly use git HEAD or svn BASE revisions (Closed)
Patch Set: fixed issues with patch set 1 Created 10 years, 9 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
« no previous file with comments | « gclient.py ('k') | scm.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) 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
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
OLDNEW
« no previous file with comments | « gclient.py ('k') | scm.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698