Mercurial > treepkg
comparison recipes/kde/enterprise/generic.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 | 10a7fed8bf80 |
children | 5a2f01685619 |
comparison
equal
deleted
inserted
replaced
524:e90a21cfbc3b | 525:e73a4bbc35e7 |
---|---|
130 revision) | 130 revision) |
131 self.tag_url = tag_url | 131 self.tag_url = tag_url |
132 self.tag_revision = tag_revision | 132 self.tag_revision = tag_revision |
133 self.tag_rules_url = tag_rules_url | 133 self.tag_rules_url = tag_rules_url |
134 self.tag_rules_revision = tag_rules_revision | 134 self.tag_rules_revision = tag_rules_revision |
135 tag_date, tag_change_count = self.tag_pkg_parameters(tag_url) | 135 tag_date, tag_change_count = self.tag_detector.tag_pkg_parameters(tag_url) |
136 pkg_revision = (self.pkg_revision_template | 136 pkg_revision = (self.pkg_revision_template |
137 % dict(pkg_revision=tag_change_count, | 137 % dict(pkg_revision=tag_change_count, |
138 rules_revision=revision[1])) | 138 rules_revision=revision[1])) |
139 return self.revision_packager_cls(self, tag=tag_url, | 139 return self.revision_packager_cls(self, tag=tag_url, |
140 pkg_revision=pkg_revision, | 140 pkg_revision=pkg_revision, |
164 self.tag_rules_url, to_dir) | 164 self.tag_rules_url, to_dir) |
165 self.rules_working_copy.export_tag(self.tag_rules_url, to_dir) | 165 self.rules_working_copy.export_tag(self.tag_rules_url, to_dir) |
166 else: | 166 else: |
167 super(PackageTrack, self).copy_debian_directory(to_dir) | 167 super(PackageTrack, self).copy_debian_directory(to_dir) |
168 | 168 |
169 def tag_pkg_parameters(self, tag_url): | |
170 match = re.search(r"/enterprise[^.]*\.[^.]*\." | |
171 r"(?P<date>[0-9]{8})\.(?P<baserev>[0-9]+)/", | |
172 tag_url) | |
173 if match: | |
174 date = match.group("date") | |
175 baserev = match.group("baserev") | |
176 xml_log = subversion.log_xml(tag_url, baserev) | |
177 revisions = subversion.extract_tag_revisions(xml_log) | |
178 tag_change_count = len(revisions) | |
179 return (date, tag_change_count) | |
180 else: | |
181 raise RuntimeError("Cannot determine tag parameters from %r" | |
182 % tag_url) |