Mercurial > hg > mercurial-crew-with-dirclash
comparison hgext/convert/subversion.py @ 4810:f7c8222920ee
convert: svn: defer get_log parsing until after get_log completes.
According to the documentation, it is not safe to perform any other
operation on the ra object until get_log completes.
author | Brendan Cully <brendan@kublai.com> |
---|---|
date | Thu, 05 Jul 2007 12:18:01 -0700 |
parents | c2d529f288a1 |
children | 1fcdf2fe3d7c |
comparison
equal
deleted
inserted
replaced
4809:c2d529f288a1 | 4810:f7c8222920ee |
---|---|
199 return relative | 199 return relative |
200 | 200 |
201 # The path is outside our tracked tree... | 201 # The path is outside our tracked tree... |
202 self.ui.debug('Ignoring %r since it is not under %r\n' % (path, module)) | 202 self.ui.debug('Ignoring %r since it is not under %r\n' % (path, module)) |
203 return None | 203 return None |
204 | |
205 received = [] | |
206 # svn.ra.get_log requires no other calls to the ra until it completes, | |
207 # so we just collect the log entries and parse them afterwards | |
208 def receivelog(*arg, **args): | |
209 received.append(arg) | |
204 | 210 |
205 self.child_cset = None | 211 self.child_cset = None |
206 def parselogentry(*arg, **args): | 212 def parselogentry(*arg, **args): |
207 orig_paths, revnum, author, date, message, pool = arg | 213 orig_paths, revnum, author, date, message, pool = arg |
208 orig_paths = svn_paths(orig_paths) | 214 orig_paths = svn_paths(orig_paths) |
444 try: | 450 try: |
445 discover_changed_paths = True | 451 discover_changed_paths = True |
446 strict_node_history = False | 452 strict_node_history = False |
447 svn.ra.get_log(self.ra, [self.module], from_revnum, to_revnum, 0, | 453 svn.ra.get_log(self.ra, [self.module], from_revnum, to_revnum, 0, |
448 discover_changed_paths, strict_node_history, | 454 discover_changed_paths, strict_node_history, |
449 parselogentry) | 455 receivelog) |
456 for entry in received: | |
457 parselogentry(*entry) | |
450 self.last_revnum = to_revnum | 458 self.last_revnum = to_revnum |
451 except SubversionException, (_, num): | 459 except SubversionException, (_, num): |
452 if num == svn.core.SVN_ERR_FS_NO_SUCH_REVISION: | 460 if num == svn.core.SVN_ERR_FS_NO_SUCH_REVISION: |
453 raise NoSuchRevision(branch=self, | 461 raise NoSuchRevision(branch=self, |
454 revision="Revision number %d" % to_revnum) | 462 revision="Revision number %d" % to_revnum) |