From 7d65467345e2b9c2a0c6a2f3f8baafa63e511bc7 Mon Sep 17 00:00:00 2001 From: "maruel@chromium.org" Date: Thu, 5 Jan 2012 19:07:23 +0000 Subject: [PATCH] Fix compatibility with svn 1.7. svn info --xml will return for new files, causing an exception in the parsing code. R=dpranke@chromium.org BUG= TEST= Review URL: http://codereview.chromium.org/9110010 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@116522 0039d316-1c4b-4281-b951-d872f2087c98 --- scm.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scm.py b/scm.py index da094fb59..0df8a1446 100644 --- a/scm.py +++ b/scm.py @@ -1,4 +1,4 @@ -# Copyright (c) 2011 The Chromium Authors. All rights reserved. +# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -578,7 +578,11 @@ class SVN(object): # Use .text when the item is not optional. result['Path'] = entry.attrib['path'] - result['Revision'] = int(entry.attrib['revision']) + rev = entry.attrib['revision'] + try: + result['Revision'] = int(rev) + except ValueError: + result['Revision'] = None result['Node Kind'] = entry.attrib['kind'] # Differs across versions. if result['Node Kind'] == 'dir':