changeset 11:6efe0bd3d8c1

Add method RevisionPackager.get_revision_numbers
author Bernhard Herzog <bh@intevation.de>
date Fri, 09 Mar 2007 15:13:13 +0100
parents 59d6055493f5
children f9f15ee39ed7
files treepkg/packager.py
diffstat 1 files changed, 11 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/treepkg/packager.py	Fri Mar 09 15:03:20 2007 +0100
+++ b/treepkg/packager.py	Fri Mar 09 15:13:13 2007 +0100
@@ -270,19 +270,23 @@
             revisions.append(subversion.last_changed_revision(directory))
         return max(revisions)
 
+    def get_revision_numbers(self):
+        """Returns a list of the numbers 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")))
+        return revisions
+
     def last_packaged_revision(self):
         """Returns the revision number of the highest packaged revision.
 
         If the revision cannot be determined because no already packaged
         revisions can be found, the function returns -1.
         """
-        revisions = [-1]
-        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")))
-        return max(revisions)
+        return max([-1] + self.get_revision_numbers())
 
     def debian_source(self):
         return util.extract_value_for_key(open(os.path.join(self.debian_dir,
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)