# HG changeset patch # User Brendan Cully # Date 1183664518 25200 # Node ID 1fcdf2fe3d7ca064224114bfa474e12837ac18b2 # Parent a5209b0487e0781ae11548196dab1f3b93cdbcb8 convert: svn: use revmap to parse only new revisions in incremental conversions diff -r a5209b0487e0 -r 1fcdf2fe3d7c hgext/convert/common.py --- a/hgext/convert/common.py Thu Jul 05 12:24:26 2007 -0700 +++ b/hgext/convert/common.py Thu Jul 05 12:41:58 2007 -0700 @@ -22,11 +22,10 @@ self.rev = rev self.encoding = 'utf-8' - self.revmap = {} def setrevmap(self, revmap): """set the map of already-converted revisions""" - self.revmap = revmap + pass def getheads(self): """Return a list of this repository's heads""" diff -r a5209b0487e0 -r 1fcdf2fe3d7c hgext/convert/subversion.py --- a/hgext/convert/subversion.py Thu Jul 05 12:24:26 2007 -0700 +++ b/hgext/convert/subversion.py Thu Jul 05 12:41:58 2007 -0700 @@ -87,6 +87,8 @@ raise NoRepo(msg) self.encoding = locale.getpreferredencoding() + self.lastrevs = {} + latest = None if rev: try: @@ -455,13 +457,21 @@ receivelog) for entry in received: parselogentry(*entry) - self.last_revnum = to_revnum except SubversionException, (_, num): if num == svn.core.SVN_ERR_FS_NO_SUCH_REVISION: raise NoSuchRevision(branch=self, revision="Revision number %d" % to_revnum) raise + def setrevmap(self, revmap): + lastrevs = {} + for revid in revmap.keys(): + uuid, module, revnum = self.revsplit(revid) + lastrevnum = lastrevs.setdefault(module, revnum) + if revnum > lastrevnum: + lastrevs[module] = revnum + self.lastrevs = lastrevs + def getheads(self): # detect standard /branches, /tags, /trunk layout optrev = svn.core.svn_opt_revision_t() @@ -532,7 +542,8 @@ uuid, module, revnum = self.revsplit(rev) self.module = module self.reparent(module) - self._fetch_revisions(from_revnum=revnum, to_revnum=0) + stop = self.lastrevs.get(module, 0) + self._fetch_revisions(from_revnum=revnum, to_revnum=stop) return self.commits[rev] def gettags(self):