Mercurial > hg
view tests/test-convert-svn-startrev.t @ 37844:8fb9985382be
pycompat: export queue module instead of symbols in module (API)
Previously, pycompat and util re-exported individual symbols from the
queue module. This had the side-effect of forcing the loading of the
queue module whenever pycompat/util was imported.
These symbols aren't used very often. So importing the module to
get a handle on the symbols is wasteful.
This commit changes pycompat so it no longer exports the individual
symbols in the queue module. Instead, we make the imported module
a "public" symbol. We drop the individual symbol aliases from the
util module. All consumers are updated to use pycompat.queue.* instead.
This change makes 300 invocations of `hg log -r. -T '{rev}\n'` a little
faster:
before: 18.44s
after: 17.87s
Differential Revision: https://phab.mercurial-scm.org/D3441
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sat, 05 May 2018 18:35:16 -0700 |
parents | 7a9cbb315d84 |
children |
line wrap: on
line source
#require svn svn-bindings $ cat >> $HGRCPATH <<EOF > [extensions] > convert = > EOF $ convert() > { > startrev=$1 > repopath=A-r$startrev-hg > hg convert --config convert.svn.startrev=$startrev \ > --config convert.svn.trunk=branches/branch1 \ > --config convert.svn.branches=" " \ > --config convert.svn.tags= \ > --datesort svn-repo $repopath > hg -R $repopath log -G \ > --template '{rev} {desc|firstline} files: {files}\n' > echo > } $ svnadmin create svn-repo $ svnadmin load -q svn-repo < "$TESTDIR/svn/startrev.svndump" Convert before branching point $ convert 3 initializing destination A-r3-hg repository scanning source... sorting... converting... 3 removeb 2 changeaa 1 branch, changeaaa 0 addc,changeaaaa o 3 addc,changeaaaa files: a c | o 2 branch, changeaaa files: a | o 1 changeaa files: a | o 0 removeb files: a Convert before branching point $ convert 4 initializing destination A-r4-hg repository scanning source... sorting... converting... 2 changeaa 1 branch, changeaaa 0 addc,changeaaaa o 2 addc,changeaaaa files: a c | o 1 branch, changeaaa files: a | o 0 changeaa files: a Convert at branching point $ convert 5 initializing destination A-r5-hg repository scanning source... sorting... converting... 1 branch, changeaaa 0 addc,changeaaaa o 1 addc,changeaaaa files: a c | o 0 branch, changeaaa files: a Convert last revision only $ convert 6 initializing destination A-r6-hg repository scanning source... sorting... converting... 0 addc,changeaaaa o 0 addc,changeaaaa files: a c