# HG changeset patch # User Bernhard Herzog # Date 1241618044 0 # Node ID 97fd2584df5f4e129cf1502d81b5a98ebc3beaf1 # Parent bba10086922199bd5da9dec98dfc749a586ed7c5 Make treepkg.subversion.last_changed_revision raise SubversionError if the last changed revision cannot be determined. diff -r bba100869221 -r 97fd2584df5f treepkg/subversion.py --- 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):