Mercurial > treepkg > treepkg
comparison treepkg/subversion.py @ 540:f7613aaa6a4e
fix issue if baserev is not a corresponding revision number
(changed since kdepim is migrated to git)
author | Bjoern Ricks <bricks@intevation.de> |
---|---|
date | Tue, 11 Jan 2011 16:04:05 +0000 |
parents | f525825d186e |
children | 8b49548aa8d4 |
comparison
equal
deleted
inserted
replaced
539:94ff51f691a2 | 540:f7613aaa6a4e |
---|---|
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 | 348 |
349 def log_xml(self, url): | |
350 """Return the log in XML of the repository since the copy | |
351 """ | |
352 args = ["--stop-on-copy", | |
353 "--verbose", | |
354 "--xml"] | |
355 return run.capture_output(cmdexpand("svn log @args $url", **locals())) | |
356 | |
349 def tag_pkg_parameters(self, tag_url): | 357 def tag_pkg_parameters(self, tag_url): |
350 # FIXME: Don't hardcore svn tag path and regex | 358 # FIXME: Don't hardcore svn tag path and regex |
351 match = re.search(r"/enterprise[^.]*\.[^.]*\." | 359 match = re.search(r"/enterprise[^.]*\.[^.]*\." |
352 r"(?P<date>[0-9]{8})\.(?P<baserev>[0-9]+)/", | 360 r"(?P<date>[0-9]{8})\.(?P<baserev>[0-9]+)/", |
353 tag_url) | 361 tag_url) |
354 if match: | 362 if match: |
355 date = match.group("date") | 363 date = match.group("date") |
364 # baserev is time since git migration | |
356 baserev = match.group("baserev") | 365 baserev = match.group("baserev") |
357 xml_log = log_xml(tag_url, baserev) | 366 xml_log = self.log_xml(tag_url) |
358 revisions = extract_tag_revisions(xml_log) | 367 revisions = extract_tag_revisions(xml_log) |
359 tag_change_count = len(revisions) | 368 tag_change_count = len(revisions) |
360 return (date, tag_change_count) | 369 return (date, tag_change_count) |
361 else: | 370 else: |
362 raise RuntimeError("Cannot determine tag parameters from %s" | 371 raise RuntimeError("Cannot determine tag parameters from %s" |