Hello everyone,

It is possible to passvarious substitution when passing revset to
`repo.revs` (eg: repo.revs("heads(%ld)", [4, 5, 6]). 

The current implementation handle this in a quick and dirty way. First a
new revset string is build:


 * code: repo.revs("heads(%ld)", [4, 5, 6])
 * transformed into (repo.revs("heads(_intlist(4, 5, 6))")
 * then revset parser build a syntax tree
 * _intlist turns its argument into a baseset

This is clever and simple, it works well for a small number of revision.
However, when the set of revision growth, this becomes ineffective. For
example, discovery might call revset where %ld is replace by hundred of
thousands of revisions. The cost of serializing and serializing them
to/from string become significant.

In addition, the serialization looses any possible optimization from the
source of revisions. For example, if we feed a smartset to `%ld` it
could be nice to keep it a smartset.


We need to improve the current situation by letting the second+ argument
of repo.revs reach the revset logic directly, without a roundtrip
through string.

I was wondering if anyone already thought about the best way to do this
(especially Yuya who tend to have code experiment around revset). If
not, we'll take a stab at it.

Cheers,
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to