changeset 269:97fd2584df5f

Make treepkg.subversion.last_changed_revision raise SubversionError if the last changed revision cannot be determined.
author Bernhard Herzog <bh@intevation.de>
date Wed, 06 May 2009 13:54:04 +0000
parents bba100869221
children e5e23c3acaea
files treepkg/subversion.py
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/treepkg/subversion.py	Wed May 06 13:52:26 2009 +0000
+++ b/treepkg/subversion.py	Wed May 06 13:54:04 2009 +0000
@@ -15,6 +15,9 @@
 from util import extract_value_for_key
 
 
+class SubversionError(Exception):
+    pass
+
 def list_url(url):
     """Runs svn list with the given url and returns files listed as a list"""
     output = run.capture_output(cmdexpand("svn list $url", **locals()))
@@ -60,8 +63,11 @@
     output = run.capture_output(cmdexpand("svn info $svn_working_copy",
                                           **locals()),
                                 env=env)
-    return int(extract_value_for_key(output.splitlines(),
-                                     "Last Changed Rev:"))
+    str_rev = extract_value_for_key(output.splitlines(), "Last Changed Rev:")
+    if str_rev is None:
+        raise SubversionError("Cannot determine last changed revision for %r"
+                              % svn_working_copy)
+    return int(str_rev)
 
 
 class SvnRepository(object):
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)