Mercurial > hg
view tests/test-mq-subrepo-svn.t @ 33766:4c706037adef
wireproto: overhaul iterating batcher code (API)
The remote batching code is difficult to read. Let's improve it.
As part of the refactor, the future returned by method calls on
batchiter() instances is now populated. However, you still need to
consume the results() generator for the future to be set. But at
least now we can stuff the future somewhere and not have to worry
about aligning method call order with result order since you can
use a future to hold the result.
Also as part of the change, we now verify that @batchable generators
yield exactly 2 values. In other words, we enforce their API.
The non-iter batcher has been unused since b6e71f8af5b8. And to my
surprise we had no explicit unit test coverage of it! test-batching.py
has been overhauled to use the iterating batcher.
Since the iterating batcher doesn't allow non-batchable method
calls nor local calls, tests have been updated to reflect reality.
The iterating batcher has been used for multiple releases apparently
without major issue. So this shouldn't cause alarm.
.. api::
@peer.batchable functions must now yield exactly 2 values
Differential Revision: https://phab.mercurial-scm.org/D319
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Wed, 09 Aug 2017 23:29:30 -0700 |
parents | 6d88468d435b |
children | 846942fd6d15 |
line wrap: on
line source
#require svn13 $ cat <<EOF >> $HGRCPATH > [extensions] > mq = > [diff] > nodates = 1 > EOF fn to create new repository, and cd into it $ mkrepo() { > hg init $1 > cd $1 > hg qinit > } handle svn subrepos safely $ svnadmin create svn-repo-2499 $ SVNREPOPATH=`pwd`/svn-repo-2499/project #if windows $ SVNREPOURL=file:///`$PYTHON -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"` #else $ SVNREPOURL=file://`$PYTHON -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"` #endif $ mkdir -p svn-project-2499/trunk $ svn import -qm 'init project' svn-project-2499 "$SVNREPOURL" qnew on repo w/svn subrepo $ mkrepo repo-2499-svn-subrepo $ svn co "$SVNREPOURL"/trunk sub Checked out revision 1. $ echo 'sub = [svn]sub' >> .hgsub $ hg add .hgsub $ hg status -S -X '**/format' A .hgsub $ hg qnew -m0 0.diff $ cd sub $ echo a > a $ svn add a A a $ svn st A* a (glob) $ cd .. $ hg status -S # doesn't show status for svn subrepos (yet) $ hg qnew -m1 1.diff abort: uncommitted changes in subrepository "sub" [255] $ cd ..