Mercurial > hg
view tests/notcapable @ 24228:542c891274b2
lazymanifest: use a binary search to do an insertion
This makes insertions log(n) plus some memmove() overhead, rather than
doing an append followed by an n*log(n) sort. There's probably a lot
of performance to be gained by adding a batch-add method, which could
be smarter about the memmove()s performed.
Includes a couple of extra tests that should help prevent bugs.
Thanks to Martin for some significant pre-mail cleanup of this change.
author | Augie Fackler <augie@google.com> |
---|---|
date | Fri, 30 Jan 2015 21:30:40 -0800 |
parents | 1ac628cd7113 |
children | dedab036215d |
line wrap: on
line source
# Disable the $CAP wire protocol capability. if test -z "$CAP" then echo "CAP environment variable not set." fi cat > notcapable-$CAP.py << EOF from mercurial import extensions, peer, localrepo def extsetup(): extensions.wrapfunction(peer.peerrepository, 'capable', wrapcapable) extensions.wrapfunction(localrepo.localrepository, 'peer', wrappeer) def wrapcapable(orig, self, name, *args, **kwargs): if name in '$CAP'.split(' '): return False return orig(self, name, *args, **kwargs) def wrappeer(orig, self): # Since we're disabling some newer features, we need to make sure local # repos add in the legacy features again. return localrepo.locallegacypeer(self) EOF echo '[extensions]' >> $HGRCPATH echo "notcapable-$CAP = `pwd`/notcapable-$CAP.py" >> $HGRCPATH