Tailors,

I've been playing around with the subversion convertor which fails at
rev. 6k or so on a repository we have at work, and is very slow. Let's
see what happens when we do not have to shell out.

As my test corpus, I have used 'svnsync' as provided by svn 1.4 or the
development version of subversion (has a better Python API) to clone the
first several thousand revisions of the subversion repository.

Bootstrap time: 30 seconds.
To revision 280 (278 actual revisions), at which point the current patch
will fail:
37 seconds (dodgy protoype usage of the api)
6m 16sec (shelling out)

It is 10x faster when using the API.

Thought you might find that interesting. I am trying to understand how
Tailor works, and am also interested in shortcutting straight from the
subversion API to the mercurial API to avoid having to use the working
copy. I am impressed with Subversion's streaming diff API, it calls your
code back to say "copy this file, edit this file, create this directory"
and so forth.

- Daniel Holth
353a354,410
>         return self._applyChangesetCommand(changeset)
>         return self._applyChangesetAPI(changeset)
> 
> 
>     def _applyChangesetAPI(self, changeset):
>         """
>         Apply changeset (wicked-fast API version)
>         """
>         from trac.log import logger_factory
>         from trac.versioncontrol.svn_fs import SubversionRepository
>         import os
> 
>         repo = getattr(self, 'repo', None)
> 
>         if repo is None:
>             print "repository is %s" % (self.repository.repository,)
>             print "module is %s" % (self.repository.module,)
>             print "trac wants to see %s" % (self.repository.repository[len("file://"):],)
>             path = self.repository.repository[len("file://"):]
>             repo = SubversionRepository(path, None, logger_factory('tailor'))
>             self.repo = repo
> 
>         chgset = repo.get_changeset(changeset.revision)
>         for ch in chgset.get_changes():
>             # ('trunk/www/webdav-usage.html', 'file', 'add', None, -1)
>             path, kind, action, frompath, fromrev = ch
>             # take module name off path
>             svnpath = path
>             path = path[len(self.repository.module):].lstrip("/")
>             make = os.path.join(self.repository.basedir, path)
>             print "apply", ch
>             if kind == 'dir':
>                 if action != 'add':
>                     raise NotImplementedError("Can't %s %s %s %s %s" % (action, kind, ch, changeset.revision, type(changeset.revision)))
>                 os.mkdir(make)
>             elif kind == 'file':
>                 filename = make
>                 if action == 'delete':
>                     # delete it!
>                     os.remove(filename)
>                 elif action in ('add', 'edit'):
>                     node = repo.get_node(svnpath, changeset.revision)
>                     target = file(filename, "w+")
>                     target.write(node.get_content().read())
>                     target.close()
>                 else:
>                     raise NotImplementedError("Can't %s %s %s" % (action, kind, ch))
>             else:
>                 print "Delegating %s" % (ch,)
>                 # Bail out to command line version.
>                 return self._applyChangesetCommand(self, changeset)
> 
> 
>     def _applyChangesetCommand(self, changeset):
>         """
>         Apply changeset (command line version)
>         """

_______________________________________________
Tailor mailing list
[email protected]
http://lists.zooko.com/mailman/listinfo/tailor

Reply via email to