Mercurial > treepkg > treepkg
comparison 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 |
comparison
equal
deleted
inserted
replaced
524:e90a21cfbc3b | 525:e73a4bbc35e7 |
---|---|
343 revision = last_changed_revision(revision_url) | 343 revision = last_changed_revision(revision_url) |
344 urlrev = (baseurl + "/" + subdir, revision) | 344 urlrev = (baseurl + "/" + subdir, revision) |
345 except SubversionError: | 345 except SubversionError: |
346 pass | 346 pass |
347 return urlrev | 347 return urlrev |
348 | |
349 def tag_pkg_parameters(self, tag_url): | |
350 # FIXME: Don't hardcore svn tag path and regex | |
351 match = re.search(r"/enterprise[^.]*\.[^.]*\." | |
352 r"(?P<date>[0-9]{8})\.(?P<baserev>[0-9]+)/", | |
353 tag_url) | |
354 if match: | |
355 date = match.group("date") | |
356 baserev = match.group("baserev") | |
357 xml_log = subversion.log_xml(tag_url, baserev) | |
358 revisions = subversion.extract_tag_revisions(xml_log) | |
359 tag_change_count = len(revisions) | |
360 return (date, tag_change_count) | |
361 else: | |
362 raise RuntimeError("Cannot determine tag parameters from %s" | |
363 % tag_url) |