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

Side by Side Diff: scm.py

Issue 9110010: Fix compatibility with svn 1.7. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 8 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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) 2011 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2011 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 """SCM-specific utility classes.""" 5 """SCM-specific utility classes."""
6 6
7 import cStringIO 7 import cStringIO
8 import glob 8 import glob
9 import logging 9 import logging
10 import os 10 import os
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 result = {} 571 result = {}
572 info = ElementTree.XML(SVN.Capture(['info', '--xml'] + files, cwd)) 572 info = ElementTree.XML(SVN.Capture(['info', '--xml'] + files, cwd))
573 if info is None: 573 if info is None:
574 return result 574 return result
575 entry = info.find('entry') 575 entry = info.find('entry')
576 if entry is None: 576 if entry is None:
577 return result 577 return result
578 578
579 # Use .text when the item is not optional. 579 # Use .text when the item is not optional.
580 result['Path'] = entry.attrib['path'] 580 result['Path'] = entry.attrib['path']
581 result['Revision'] = int(entry.attrib['revision']) 581 rev = entry.attrib['revision']
582 try:
583 result['Revision'] = int(rev)
584 except ValueError:
585 result['Revision'] = None
582 result['Node Kind'] = entry.attrib['kind'] 586 result['Node Kind'] = entry.attrib['kind']
583 # Differs across versions. 587 # Differs across versions.
584 if result['Node Kind'] == 'dir': 588 if result['Node Kind'] == 'dir':
585 result['Node Kind'] = 'directory' 589 result['Node Kind'] = 'directory'
586 result['URL'] = entry.find('url').text 590 result['URL'] = entry.find('url').text
587 repository = entry.find('repository') 591 repository = entry.find('repository')
588 result['Repository Root'] = repository.find('root').text 592 result['Repository Root'] = repository.find('root').text
589 result['UUID'] = repository.find('uuid') 593 result['UUID'] = repository.find('uuid')
590 wc_info = entry.find('wc-info') 594 wc_info = entry.find('wc-info')
591 if wc_info is not None: 595 if wc_info is not None:
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
1044 # revert, like for properties. 1048 # revert, like for properties.
1045 if not os.path.isdir(cwd): 1049 if not os.path.isdir(cwd):
1046 # '.' was deleted. It's not worth continuing. 1050 # '.' was deleted. It's not worth continuing.
1047 return 1051 return
1048 try: 1052 try:
1049 SVN.Capture(['revert', file_status[1]], cwd=cwd) 1053 SVN.Capture(['revert', file_status[1]], cwd=cwd)
1050 except subprocess2.CalledProcessError: 1054 except subprocess2.CalledProcessError:
1051 if not os.path.exists(file_path): 1055 if not os.path.exists(file_path):
1052 continue 1056 continue
1053 raise 1057 raise
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698