sapling/mercurial
Durham Goode 5a5c8eeb9e revset: use smartset minus operator
Previously, revsets like 'X - Y' were translated to be 'X and not Y'. This can
be expensive, since if Y is a single commit then 'not Y' becomes a huge set and
sometimes the query optimizer doesn't account for it well.

This patch changes revsets to use the built in smartset minus operator, which is
often smarter than 'X and not Y'.

On a large repo this saves 2.2 seconds on rebase and histedit because "X:: - X"
becomes almost instant.

Relevant performance numbers from revsetbenchmark.py

revset #13: roots((tip~100::) - (tip~100::tip))
   plain         min           max           first         last          reverse       rev..rst      rev..ast      sort          sor..rst      sor..ast
0) 0.001080      0.001107      0.001102      0.001118      0.001121      0.001114      0.001141      0.001123      0.001099      0.001123      0.001137
1) 0.000708  65% 0.000738  66% 0.000735  66% 0.000739  66% 0.000784  69% 0.000780  70% 0.000807  70% 0.000756  67% 0.000727  66% 0.000759  67% 0.000808  71%

revset #14: roots((0::) - (0::tip))
   plain         min           max           first         last          reverse       rev..rst      rev..ast      sort          sor..rst      sor..ast
0) 0.131304      0.079168      0.133129      0.076560      0.048179      0.133349      0.049153      0.077097      0.129689      0.076212      0.048543
1) 0.065066  49% 0.036941  46% 0.066063  49% 0.034755  45% 0.048558      0.071091  53% 0.047679      0.034984  45% 0.064572  49% 0.035680  46% 0.048508

revset #22: (not public() - obsolete())
   plain         min           max           first         last          reverse       rev..rst      rev..ast      sort          sor..rst      sor..ast
0) 0.000139      0.000133      0.000133      0.000138      0.000134      0.000155      0.000157      0.000152      0.000157      0.000156      0.000153
1) 0.000108  77% 0.000129      0.000129      0.000134      0.000132      0.000127  81% 0.000151      0.000147      0.000127  80% 0.000152      0.000149

revset #25: (20000::) - (20000)
   plain         min           max           first         last          reverse       rev..rst      rev..ast      sort          sor..rst      sor..ast
0) 0.050560      0.045513      0.022593      0.043588      0.021909      0.045517      0.021822      0.044660      0.049740      0.044227      0.021819
1) 0.018614  36% 0.000171   0% 0.019659  87% 0.000168   0% 0.015543  70% 0.021069  46% 0.015623  71% 0.000180   0% 0.018658  37% 0.000186   0% 0.015750  72%
2016-02-24 10:41:15 -08:00
..
default.d mergetools.rc: find OSX FileMerge in the new location inside Xcode 4.3 2015-10-16 11:37:34 +02:00
help progress: display progress bar when HGPLAINEXCEPT contains "progress" 2016-02-17 15:18:30 -08:00
hgweb hgweb: add option to convert encoding of graphdata() 2016-01-04 23:05:09 +09:00
httpclient httpclient: update to 938f2107d6e2 of httpplus 2015-12-31 13:19:20 -05:00
pure osutil: do not abort loading pure module just because libc has no recvmsg() 2016-02-03 22:47:27 +09:00
templates templatefilters: make json filter be byte-transparent (BC) (issue4926) 2015-12-27 17:59:57 +09:00
__init__.py mercurial: support loading modules from zipimporter 2015-12-03 21:25:05 -08:00
ancestor.py ancestor: use absolute_import 2015-08-07 19:45:48 -07:00
archival.py match: rename "narrowmatcher" to "subdirmatcher" (API) 2016-02-05 21:09:32 -08:00
base85.c base85: fix comparison of an int and a long 2015-08-21 14:29:42 -04:00
bdiff.c bdiff: avoid a memory error on malloc failure 2013-10-30 16:03:42 -05:00
bookmarks.py bookmarks: add 'hg push -B .' for pushing the active bookmark (issue4917) 2016-02-19 22:28:09 +01:00
branchmap.py error: get Abort from 'error' instead of 'util' 2015-10-08 12:55:45 -07:00
bundle2.py changegroup: fix pulling to treemanifest repo from flat repo (issue5066) 2016-01-27 09:07:28 -08:00
bundlerepo.py bundlerepo: properly handle hidden linkrev in filelog (issue4945) 2016-02-22 18:35:40 +01:00
byterange.py byterange: use absolute_import 2015-12-21 21:42:14 -08:00
changegroup.py changegroup: fix pulling to treemanifest repo from flat repo (issue5066) 2016-01-27 09:07:28 -08:00
changelog.py reachableroots: construct and sort baseset in revset module 2015-08-28 11:14:24 +09:00
cmdutil.py serve: allow --daemon-postexec to be 'unlink:path' or 'none' 2016-02-22 17:30:02 +00:00
commands.py serve: rename --daemon-pipefds to --daemon-postexec (BC) 2016-02-22 16:59:08 +00:00
commandserver.py commandserver: use _readlist 2016-02-15 14:20:41 +00:00
config.py config: add hasconfig method and supporting plumbing 2016-01-07 19:45:03 -08:00
context.py filectx: replace use of _filerev with _filenode 2016-02-08 14:17:11 -08:00
copies.py copies: optimize forward copy detection logic for rebases 2016-02-05 13:23:24 -08:00
crecord.py crecord: fix help bar display issue (issue5063) 2016-01-25 11:37:02 -08:00
dagparser.py error: get Abort from 'error' instead of 'util' 2015-10-08 12:55:45 -07:00
dagutil.py dagutil: use absolute_import 2015-08-08 19:04:09 -07:00
demandimport.py demandimport: blacklist sqlalchemy.events as it has side effects (issue5085) 2016-02-06 19:16:12 +09:00
destutil.py rebase: choose default destination the same way as 'hg merge' (BC) 2016-02-14 13:25:59 +00:00
diffhelpers.c diffhelpers: fix botched return statement from e48d70075d8a 2015-01-28 13:34:20 -05:00
dirs.c dirs._addpath: reinstate use of Py_CLEAR 2015-04-07 20:43:04 -07:00
dirstate.py dirstate: add a way to get the ignore file/line matching an ignored file 2016-01-05 07:52:04 -08:00
discovery.py discovery: pass pushop to _nowarnheads 2015-11-10 11:16:25 -08:00
dispatch.py dispatch: strip command line options like config file options 2016-02-08 15:35:30 -08:00
dummycert.pem ssl: on OS X, use a dummy cert to trick Python/OpenSSL to use system CA certs 2014-09-26 02:19:48 +02:00
encoding.py encoding: backport paranoid escaping from templatefilters.jsonescape() 2015-12-27 19:58:11 +09:00
error.py destutil: add more precise error classes for destmerge 2016-02-09 23:30:41 +00:00
exchange.py bookmarks: add 'hg push -B .' for pushing the active bookmark (issue4917) 2016-02-19 22:28:09 +01:00
exewrapper.c exewrapper: add comments about PYTHONHOME 2015-10-14 12:23:49 +02:00
extensions.py extensions: add notloaded method to return extensions failed to load 2016-02-10 16:59:34 +00:00
fancyopts.py error: get Abort from 'error' instead of 'util' 2015-10-08 12:55:45 -07:00
filelog.py filelog: use absolute_import 2015-08-08 19:11:42 -07:00
filemerge.py origpath: move from cmdutil to scmutil 2016-01-02 03:02:57 -08:00
fileset.py error: get Abort from 'error' instead of 'util' 2015-10-08 12:55:45 -07:00
formatter.py error: get Abort from 'error' instead of 'util' 2015-10-08 12:55:45 -07:00
graphmod.py graphmod: compute slow revset query once prior to reachableroots (issue4782) 2015-09-08 23:00:44 +09:00
hbisect.py with: use context manager in bisect save_state 2016-01-15 13:14:49 -08:00
help.py help: don't crash in keyword search if an extension fails to provide docs 2016-02-10 01:48:58 -08:00
hg.py hg: perform update after pulling during clone with share (issue5103) 2016-02-20 17:44:29 -08:00
hook.py hook: don't crash on syntax errors in python hooks 2016-02-12 14:50:10 -08:00
httpconnection.py httpconnection: remove a mutable default argument 2015-09-24 00:54:30 -07:00
httppeer.py cleanup: remove superfluous space after space after equals (python) 2015-12-31 08:16:59 +00:00
i18n.py i18n: use absolute_import 2015-08-08 19:28:49 -07:00
keepalive.py keepalive: use print function 2015-06-21 23:14:54 -07:00
localrepo.py localrepo: support background closing for wwrite() 2016-02-20 15:25:27 -08:00
lock.py util: enable getpid to be replaced 2016-02-03 09:11:22 +00:00
lsprof.py lsprof: use print function 2016-01-02 11:40:53 -08:00
lsprofcalltree.py lsprofcalltree: use print function 2016-01-02 11:45:29 -08:00
mail.py mail: use print function 2016-01-02 11:47:07 -08:00
manifest.c lazymanifest: check more return values in filtercopy 2015-12-31 13:31:42 -05:00
manifest.py treemanifest: allow setting flag to 't' 2016-02-09 20:22:33 -08:00
match.py match: override 'visitdir' in subdirmatcher 2016-02-05 21:25:44 -08:00
mdiff.py mdiff: don't emit a diff header for empty trivial deltas 2016-01-11 22:00:07 -05:00
merge.py merge: perform background file closing in batchget 2016-02-20 15:54:09 -08:00
minirst.py minirst: change hgrole to use single quotes 2016-01-12 06:03:36 +00:00
mpatch.c mpatch: rewrite pointer overflow checks 2013-12-11 18:33:42 -06:00
namespaces.py namespaces: use absolute_import 2015-08-08 19:42:58 -07:00
node.py node: add 'nullhex', hex-encoded nullid 2015-11-16 11:23:32 -08:00
obsolete.py obsolete: fix n^2 marker computation behavior 2016-02-04 15:38:04 -08:00
osutil.c osutil: disable compilation of recvfds() on unsupported platforms 2016-02-02 20:56:48 +09:00
parser.py parser: move unescape helper from templater 2015-09-10 23:25:10 +09:00
parsers.c cleanup: remove superfluous space after space after equals (C) 2015-12-31 08:17:15 +00:00
patch.py diff: don't crash when merged-in addition is copied 2016-01-14 10:22:55 -08:00
pathencode.c pathencode: remove an unused assignment 2015-12-12 20:59:37 -08:00
pathutil.py pathauditor: change parts verification order to be root first 2016-02-11 17:04:33 -08:00
peer.py peer: use absolute_import 2015-08-08 19:45:45 -07:00
phases.py phases: use constants for phase values 2016-02-15 16:49:52 -08:00
posix.py posix: fix test-permissions regression 2015-11-09 15:53:11 -06:00
progress.py progress: display progress bar when HGPLAINEXCEPT contains "progress" 2016-02-17 15:18:30 -08:00
pushkey.py pushkey: use absolute_import 2015-08-08 19:57:27 -07:00
pvec.py pvec: use absolute_import 2015-12-21 21:32:58 -08:00
py3kcompat.py py3compat: use absolute_import 2015-12-21 21:31:57 -08:00
registrar.py registrar: add delayregistrar class to register function in extensions 2015-12-29 23:58:30 +09:00
repair.py treemanifest: fix debugrebuildfncache 2016-02-07 21:44:38 -08:00
repoview.py repoview: fix corrupted hiddencache crash Mercurial (issue5042) 2016-01-20 13:43:01 -08:00
revlog.py revlog: fix bad indentation (replace tab by space) 2015-12-18 20:54:41 -08:00
revset.py revset: use smartset minus operator 2016-02-24 10:41:15 -08:00
scmposix.py scmposix: use absolute_import 2015-12-21 21:24:49 -08:00
scmutil.py scmutil: support background closing for write() 2016-02-20 15:24:12 -08:00
scmwindows.py windows: read all global config files, not just the first (issue4491) (BC) 2015-10-12 20:13:12 +02:00
setdiscovery.py error: get Abort from 'error' instead of 'util' 2015-10-08 12:55:45 -07:00
similar.py similar: use absolute_import 2015-12-12 23:17:22 -08:00
simplemerge.py merge: minimize conflicts when common base is not shown (issue4447) 2016-02-10 09:06:08 -08:00
sshpeer.py sshpeer: make remotelock a context manager 2016-01-15 13:14:50 -08:00
sshserver.py error: get Abort from 'error' instead of 'util' 2015-10-08 12:55:45 -07:00
sslutil.py sslutil: fix reversed logic (issue5034) 2016-01-08 16:27:25 +01:00
statichttprepo.py statichttprepo: implement __enter__ and __exit__ on httprangeheader 2016-01-02 15:33:01 -08:00
store.py treemanifests: fix streaming clone 2016-02-04 08:34:07 -08:00
streamclone.py streamclone: use backgroundfilecloser (issue4889) 2016-01-14 13:44:01 -08:00
strutil.py strutil: use absolute_import 2015-08-08 20:01:40 -07:00
subrepo.py match: rename "narrowmatcher" to "subdirmatcher" (API) 2016-02-05 21:09:32 -08:00
tagmerge.py tagmerge: use absolute_import 2015-08-08 20:10:46 -07:00
tags.py tags: create new sortdict for performance reasons 2015-11-12 13:16:04 -08:00
templatefilters.py templatefilters: drop old jsonescape() function 2015-12-27 18:50:03 +09:00
templatekw.py templater: factor out type conversion of revset() result 2016-02-12 18:39:48 +09:00
templater.py templater: factor out type conversion of revset() result 2016-02-12 18:39:48 +09:00
transaction.py transaction: abort transaction during hook exception 2016-01-19 15:18:21 -08:00
treediscovery.py error: get Abort from 'error' instead of 'util' 2015-10-08 12:55:45 -07:00
ui.py config: drop progress extension from sample hgrc as it is in core now 2015-12-15 23:50:48 +09:00
unionrepo.py merge with stable 2016-01-13 15:47:37 -06:00
url.py url: drop support for python2.5 2015-10-15 17:21:08 -04:00
util.h util: fix the check for non-C99 compilers (issue4605) 2015-04-20 22:21:57 -05:00
util.py util: enable getpid to be replaced 2016-02-03 09:11:22 +00:00
verify.py verify: show progress while verifying dirlogs 2016-02-11 15:38:56 -08:00
win32.py win32: use absolute_import 2015-08-08 18:52:59 -07:00
windows.py windows: insert file positioning call between reads and writes 2015-09-27 18:46:53 -07:00
wireproto.py wireproto: support disabling bundle1 only if repo is generaldelta 2015-12-20 11:56:24 -08:00
worker.py worker: change partition strategy to every Nth element 2016-02-20 15:56:44 -08:00