Mercurial > treepkg
changeset 328:dd2bd0ccd674
Revisions are now handled as strings
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Wed, 17 Mar 2010 14:26:16 +0000 |
parents | f5282057838a |
children | e749fe36ece3 |
files | bin/listpackages.py bin/listpendingnotifications.py treepkg/git.py treepkg/packager.py |
diffstat | 4 files changed, 15 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/bin/listpackages.py Wed Mar 17 13:42:42 2010 +0000 +++ b/bin/listpackages.py Wed Mar 17 14:26:16 2010 +0000 @@ -43,11 +43,11 @@ if len(split_revision) > 2: raise ValueError("Cannot parse revision %r; too many '-' signs" % raw_revision) - revision = int(split_revision[0]) + revision = split_revision[0] if len(split_revision) == 1: rulesrev = None else: - rulesrev = int(split_revision[1]) + rulesrev = split_revision[1] return revision, rulesrev
--- a/bin/listpendingnotifications.py Wed Mar 17 13:42:42 2010 +0000 +++ b/bin/listpendingnotifications.py Wed Mar 17 14:26:16 2010 +0000 @@ -20,7 +20,7 @@ for track in group.get_package_tracks(): for revision in track.get_revisions(): if revision.status.notification_mail.name == "notification_pending": - print "%s %s %d %d" % (revision.status.status.name, + print "%s %s %s %s" % (revision.status.status.name, track.name, revision.revision, revision.rules_revision) revision.status.notification_sent()
--- a/treepkg/git.py Wed Mar 17 13:42:42 2010 +0000 +++ b/treepkg/git.py Wed Mar 17 14:26:16 2010 +0000 @@ -41,14 +41,13 @@ cwd=src) def last_changed_revision(git_working_copy): - """Return the number of commits in the current branch""" - output = run.capture_output(cmdexpand("/bin/bash -c \ - \"git rev-list local | wc -l \"" - , **locals()), cwd=git_working_copy) + """Return the SHA1 sum of the latest commit""" + output = run.capture_output(cmdexpand("git rev-parse HEAD"), + cwd=git_working_copy) if output is None: raise GitError("Cannot determine last changed revision for %r" - % git_working_copy) - return int(output) + % git_working_copy) + return output.strip() class GitRepository(object):
--- a/treepkg/packager.py Wed Mar 17 13:42:42 2010 +0000 +++ b/treepkg/packager.py Wed Mar 17 14:26:16 2010 +0000 @@ -366,9 +366,9 @@ self.do_build = do_build self.handle_dependencies = handle_dependencies self.dependencies = None - self.pkg_dir_template = "%(revision)d-%(rules_revision)d" - self.pkg_dir_regex = re.compile(r"(?P<revision>[0-9]+)" - r"-(?P<rules_revision>[0-9]+)$") + self.pkg_dir_template = "%(revision)s-%(rules_revision)s" + self.pkg_dir_regex = re.compile(r"(?P<revision>[0-9a-f]+)" + r"-(?P<rules_revision>[0-9a-f]+)$") externals = svn_externals if not externals: externals = self.svn_external_subdirs @@ -380,9 +380,6 @@ repo = GitRepository(git_url, branch=git_branch) self.working_copy = GitWorkingCopy(repo, self.checkout_dir, logger=logging) - else: - print "No Repository URL for %s" % name - raise if rules_svn_url: repo = SvnRepository(rules_svn_url) self.rules_working_copy = SvnWorkingCopy(repo, self.debian_dir, @@ -444,16 +441,15 @@ return self.working_copy.last_changed_revision() def get_revision_numbers(self): - """Returns a list of the numbers of the packaged revisions""" + """Returns a list of the packaged revisions""" revisions = [] if os.path.exists(self.pkg_dir): for filename in os.listdir(self.pkg_dir): match = self.pkg_dir_regex.match(filename) if match: - revisions.append((int(match.group("revision")), - int(match.group("rules_revision")))) - revisions.sort() - return revisions + revisions.append((match.group("revision"), + match.group("rules_revision"))) + return sorted(revisions) def update_checkout(self, revision=None): """Updates the working copy.