diff --git a/bin/svndbadmin b/bin/svndbadmin index 94d7e915..ac1ee664 100755 --- a/bin/svndbadmin +++ b/bin/svndbadmin @@ -142,13 +142,16 @@ class SvnRev: subpool = svn.core.svn_pool_create(pool) # revision properties ... - properties = svn.fs.revision_proplist(repo.fs, rev, pool) - self.author = str(properties.get(svn.core.SVN_PROP_REVISION_AUTHOR,'')) - self.date = str(properties.get(svn.core.SVN_PROP_REVISION_DATE, '')) - self.log = str(properties.get(svn.core.SVN_PROP_REVISION_LOG, '')) + revprops = svn.fs.revision_proplist(repo.fs, rev, pool) + self.author = str(revprops.get(svn.core.SVN_PROP_REVISION_AUTHOR,'')) + self.date = str(revprops.get(svn.core.SVN_PROP_REVISION_DATE, '')) + self.log = str(revprops.get(svn.core.SVN_PROP_REVISION_LOG, '')) # convert the date string to seconds since epoch ... - self.date = svn.core.secs_from_timestr(self.date, pool) + try: + self.date = svn.core.secs_from_timestr(self.date, pool) + except: + self.date = None # get a root for the current revisions fsroot = self._get_root_for_rev(rev) diff --git a/lib/cvsdb.py b/lib/cvsdb.py index 5f3a6b4a..8dafa220 100644 --- a/lib/cvsdb.py +++ b/lib/cvsdb.py @@ -240,7 +240,7 @@ class CheckinDatabase: self.AddCommit(commit) def AddCommit(self, commit): - ci_when = dbi.DateTimeFromTicks(commit.GetTime()) + ci_when = dbi.DateTimeFromTicks(commit.GetTime() or 0.0) ci_type = commit.GetTypeString() who_id = self.GetAuthorID(commit.GetAuthor()) repository_id = self.GetRepositoryID(commit.GetRepository()) @@ -531,10 +531,15 @@ class Commit: return self.__revision def SetTime(self, gmt_time): - self.__gmt_time = float(gmt_time) + if gmt_time is None: + ### We're just going to assume that a datestamp of The Epoch + ### ain't real. + self.__gmt_time = 0.0 + else: + self.__gmt_time = float(gmt_time) def GetTime(self): - return self.__gmt_time + return self.__gmt_time and self.__gmt_time or None def SetAuthor(self, author): self.__author = author