# HG changeset patch # User Andre Heinecke # Date 1268835976 0 # Node ID dd2bd0ccd6743da82eb303d51c1aab750764dd49 # Parent f5282057838a7f31cc098067b6c9556cfdce1f62 Revisions are now handled as strings diff -r f5282057838a -r dd2bd0ccd674 bin/listpackages.py --- 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 diff -r f5282057838a -r dd2bd0ccd674 bin/listpendingnotifications.py --- 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() diff -r f5282057838a -r dd2bd0ccd674 treepkg/git.py --- 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): diff -r f5282057838a -r dd2bd0ccd674 treepkg/packager.py --- 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[0-9]+)" - r"-(?P[0-9]+)$") + self.pkg_dir_template = "%(revision)s-%(rules_revision)s" + self.pkg_dir_regex = re.compile(r"(?P[0-9a-f]+)" + r"-(?P[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.