sapling/infinitepush
Jun Wu 40b5838e3e revset: optimize "head() & draft()" to "heads(draft())"
`head()` has visible overhead if there are too many heads (ex. 10k+).
Usually when we only care about draft heads, `heads(draft())` is better
since `draft()` are usually pre-calculated and the revset gets calculated as
`draft() - parents(draft())`, unrelated to the number of total heads.

Note that `head() & draft()` and `heads(draft())` are not strictly
equivalent (ex, a head with a secret phase) so it's changing the behavior a
bit. The new behavior is probably more desirable - in both smartlog and
backup case, people do want to see/backup the draft head, regardless of
whether it has secret descendants or not.

This makes `smartlogrevset` take 50ms less:

Before:

  148           | smartlogrevset                smartlog.py:438
  117            \ revs (3 times)               localrepo.py:783
  116             | mfunc (3 times)             revset.py:2202
  116             | getset (3 times)            revset.py:92
  116             | andset (2 times)            revset.py:165
  116             | getset (4 times)            revset.py:92
   62              \ andset (2 times)           revset.py:165
   62               | getset (4 times)          revset.py:92
   78                \ func (3 times)           revset.py:235
   49                  \ head (2 times)         revset.py:1117
   49                    \ branchmap (4 times)  localrepo.py:953
   46                    \ <genexpr> (16348 times) revset.py:1126
   38                     | rev (16344 times)   changelog.py:353 <<<< too many heads
   67                  \ branch (2 times)       revset.py:465
   42                    \ wrapper (2 times)    localrepo.py:141
   42                     | revbranchcache (2 times) localrepo.py:959
   40                     | __init__            branchmap.py:354
   12                     | read (2 times)      vfs.py:78
   25                    \ branchmap (2 times)  localrepo.py:953
   25                \ andset                   revset.py:165
   30              \ func (2 times)             revset.py:235
   30               | notbackedup               backupcommands.py:302
   52               | _backupheads (2 times)    backupcommands.py:389
   28            \ _masterrev                   smartlog.py:426

After:

   99       | smartlogrevset                    smartlog.py:438
   69        \ revs (3 times)                   localrepo.py:783
   68         | mfunc (3 times)                 revset.py:2202
   68         | getset (3 times)                revset.py:92
   68         | andset (2 times)                revset.py:165
   68         | getset (4 times)                revset.py:92
   13         | andset                          revset.py:165
   13         | getset (2 times)                revset.py:92
   27        \ _masterrev                       smartlog.py:426

Differential Revision: https://phab.mercurial-scm.org/D1448
2017-11-21 15:41:57 -08:00
..
__init__.py infinitepush: respect treemanifest cansendtrees config 2017-11-13 11:22:57 -08:00
backupcommands.py revset: optimize "head() & draft()" to "heads(draft())" 2017-11-21 15:41:57 -08:00
bundleparts.py infinitepush: send treepack parts with the client push 2017-11-01 17:10:05 -07:00
common.py configs: remove config defaults for registered configs 2017-10-24 17:54:02 -07:00
fileindexapi.py infinitepush: put metadata fill in wlock 2017-07-17 04:02:43 -07:00
indexapi.py checkcode: remove unnecessary 'pass' statements 2017-10-04 18:55:07 -07:00
infinitepushcommands.py infinitepush: add metadatafilelimit option 2017-06-19 01:27:31 -07:00
README infinitepush: sample implementation 2016-08-26 06:09:01 -07:00
schema.sql infinitepush: update schema 2017-06-15 02:36:40 -07:00
sqlindexapi.py infinitepush: add reponame to WHERE clause 2017-11-02 13:24:53 -07:00
store.py infinitepush: fix string formatting 2017-02-03 07:10:53 -08:00

## What is it?

This extension adds ability to save certain pushes to a remote blob store
as bundles and to serve commits from remote blob store.
The revisions are stored on disk or in everstore.
The metadata are stored in sql or on disk.

## Config options

infinitepush.branchpattern: pattern to detect a scratchbranch, example
                            're:scratch/.+'

infinitepush.indextype: disk or sql for the metadata
infinitepush.reponame: only relevant for sql metadata backend, reponame to put in
                       sql

infinitepush.indexpath: only relevant for ondisk metadata backend, the path to
                        store the index on disk. If not set will be under .hg
                        in a folder named filebundlestore

infinitepush.storepath: only relevant for ondisk metadata backend, the path to
                        store the bundles. If not set, it will be
                        .hg/filebundlestore