Mercurial > treepkg > treepkg
diff treepkg/subversion.py @ 525:e73a4bbc35e7
tag_pkg_parameters depends on scm therefore move this method to the
tagdetetors which are scm aware
currently bot tag_pkg_parameters (for git and svn) contain hardcoded
regular expressions which should be removed in future
author | Bjoern Ricks <bricks@intevation.de> |
---|---|
date | Mon, 15 Nov 2010 14:34:15 +0000 |
parents | 2ecdfa0f345a |
children | f525825d186e |
line wrap: on
line diff
--- a/treepkg/subversion.py Thu Nov 11 11:50:08 2010 +0000 +++ b/treepkg/subversion.py Mon Nov 15 14:34:15 2010 +0000 @@ -345,3 +345,19 @@ except SubversionError: pass return urlrev + + def tag_pkg_parameters(self, tag_url): + # FIXME: Don't hardcore svn tag path and regex + match = re.search(r"/enterprise[^.]*\.[^.]*\." + r"(?P<date>[0-9]{8})\.(?P<baserev>[0-9]+)/", + tag_url) + if match: + date = match.group("date") + baserev = match.group("baserev") + xml_log = subversion.log_xml(tag_url, baserev) + revisions = subversion.extract_tag_revisions(xml_log) + tag_change_count = len(revisions) + return (date, tag_change_count) + else: + raise RuntimeError("Cannot determine tag parameters from %s" + % tag_url)