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

Side by Side Diff: checkout.py

Issue 1471973004: Fix some path processing to work better on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: lint Created 5 years 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 | « no previous file | cit.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 # coding=utf8 1 # coding=utf8
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 """Manages a project checkout. 5 """Manages a project checkout.
6 6
7 Includes support for svn, git-svn and git. 7 Includes support for svn, git-svn and git.
8 """ 8 """
9 9
10 import ConfigParser 10 import ConfigParser
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 class SvnConfig(object): 248 class SvnConfig(object):
249 """Parses a svn configuration file.""" 249 """Parses a svn configuration file."""
250 def __init__(self, svn_config_dir=None): 250 def __init__(self, svn_config_dir=None):
251 super(SvnConfig, self).__init__() 251 super(SvnConfig, self).__init__()
252 self.svn_config_dir = svn_config_dir 252 self.svn_config_dir = svn_config_dir
253 self.default = not bool(self.svn_config_dir) 253 self.default = not bool(self.svn_config_dir)
254 if not self.svn_config_dir: 254 if not self.svn_config_dir:
255 if sys.platform == 'win32': 255 if sys.platform == 'win32':
256 self.svn_config_dir = os.path.join(os.environ['APPDATA'], 'Subversion') 256 self.svn_config_dir = os.path.join(os.environ['APPDATA'], 'Subversion')
257 else: 257 else:
258 self.svn_config_dir = os.path.join(os.environ['HOME'], '.subversion') 258 self.svn_config_dir = os.path.expanduser(
259 os.path.join('~', '.subversion'))
259 svn_config_file = os.path.join(self.svn_config_dir, 'config') 260 svn_config_file = os.path.join(self.svn_config_dir, 'config')
260 parser = ConfigParser.SafeConfigParser() 261 parser = ConfigParser.SafeConfigParser()
261 if os.path.isfile(svn_config_file): 262 if os.path.isfile(svn_config_file):
262 parser.read(svn_config_file) 263 parser.read(svn_config_file)
263 else: 264 else:
264 parser.add_section('auto-props') 265 parser.add_section('auto-props')
265 self.auto_props = dict(parser.items('auto-props')) 266 self.auto_props = dict(parser.items('auto-props'))
266 267
267 268
268 class SvnMixIn(object): 269 class SvnMixIn(object):
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
829 def revisions(self, rev1, rev2): 830 def revisions(self, rev1, rev2):
830 return self.checkout.revisions(rev1, rev2) 831 return self.checkout.revisions(rev1, rev2)
831 832
832 @property 833 @property
833 def project_name(self): 834 def project_name(self):
834 return self.checkout.project_name 835 return self.checkout.project_name
835 836
836 @property 837 @property
837 def project_path(self): 838 def project_path(self):
838 return self.checkout.project_path 839 return self.checkout.project_path
OLDNEW
« no previous file with comments | « no previous file | cit.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698