From 57da0a1b833c6fced575ccf00d4aef2ef7b99e19 Mon Sep 17 00:00:00 2001 From: mhagger Date: Thu, 9 Dec 2010 08:45:51 +0000 Subject: [PATCH] Improve error reporting of ValueExceptions emitted by rcsparse. Patch by: Craig Leres (Submitted with issue #141.) Comment (copied from issue): I had a really old RCS ,v file that had a bad year in a date string (100.01.05.12.00.52) and it was a fair amount of work to figure out what the problem was. In the process I made a couple of short patches to cvs2svn to provide additional info when the error is "invalid year"; patches attached. git-svn-id: http://cvs2svn.tigris.org/svn/cvs2svn/trunk@5308 be7e6eca-30d4-0310-a8e5-ac0d63af7087 --- cvs2svn_lib/collect_data.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cvs2svn_lib/collect_data.py b/cvs2svn_lib/collect_data.py index 7e0d072e..e30cfa13 100644 --- a/cvs2svn_lib/collect_data.py +++ b/cvs2svn_lib/collect_data.py @@ -1036,13 +1036,20 @@ class _ProjectDataCollector: fdc = _FileDataCollector(self, cvs_file) try: cvs2svn_rcsparse.parse(open(cvs_file.rcs_path, 'rb'), fdc) - except (cvs2svn_rcsparse.common.RCSParseError, ValueError, RuntimeError): + except (cvs2svn_rcsparse.common.RCSParseError, RuntimeError): self.collect_data.record_fatal_error( "%r is not a valid ,v file" % (cvs_file.rcs_path,) ) # Abort the processing of this file, but let the pass continue # with other files: return + except ValueError, e: + self.collect_data.record_fatal_error( + "%r is not a valid ,v file (%s)" % (cvs_file.rcs_path, str(e),) + ) + # Abort the processing of this file, but let the pass continue + # with other files: + return except: logger.warn("Exception occurred while parsing %s" % cvs_file.rcs_path) raise -- 2.11.4.GIT