summaryrefslogtreecommitdiff
path: root/lib/spack/spack/fetch_strategy.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/spack/spack/fetch_strategy.py')
-rw-r--r--lib/spack/spack/fetch_strategy.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/spack/spack/fetch_strategy.py b/lib/spack/spack/fetch_strategy.py
index bafd99f885..dd7ebd248b 100644
--- a/lib/spack/spack/fetch_strategy.py
+++ b/lib/spack/spack/fetch_strategy.py
@@ -26,6 +26,7 @@ import sys
import re
import shutil
import copy
+import xml.etree.ElementTree
from functools import wraps
from six import string_types, with_metaclass
@@ -771,13 +772,9 @@ class SvnFetchStrategy(VCSFetchStrategy):
return self.revision
def get_source_id(self):
- output = self.svn('info', self.url, output=str)
- if not output:
- return None
- lines = output.split('\n')
- for line in lines:
- if line.startswith('Revision:'):
- return line.split()[-1]
+ output = self.svn('info', '--xml', self.url, output=str)
+ info = xml.etree.ElementTree.fromstring(output)
+ return info.find('entry/commit').get('revision')
@_needs_stage
def fetch(self):