[RFC] external revsets and templates

Kevin Bullock kbullock+mercurial at ringworld.org
Fri Jul 15 12:00:34 EDT 2016


> On Jul 14, 2016, at 16:17, Matt Mackall <mpm at selenic.com> wrote:
> 
>> On Wed, 2016-07-13 at 23:50 -0700, Gregory Szorc wrote:
>> 
>>> On Wed, Jul 13, 2016 at 11:37 AM, Matt Mackall <mpm at selenic.com> wrote:
>>> 
>>> Also, we should allow data sources that are arbitrary URLs:
>>> 
>>>  [extrevset]
>>>  tested = url:http://build.corp.example.com/hg-tested.dat
>>>  good = url:http://build.corp.example.com/hg-passed.dat
>>>  deployed = url:http://prod.example.com/hg-deployed.cgi
>>>  fulltext = url:http://hg
>>> -fulltext-db.example.com/query?string=$1
>>> 
>>> ..which will allow very easy integration with complex production
>>> automation. The
>>> url: piece might be redundant here? We might also allow calling Python,
>>> similar
>>> to how we allow it in hooks.
>> 
>> That's really hot. We probably want to bikeshed HTTP semantics a bit. e.g.
>> how do you differentiate between an empty result and a server error. HTTP
>> status code?
> 
> Yes, my thought is stay really simple here. Exception raised reading results =
> abort to fail safe. We don't want writing deploy scripts that silently update
> back to null because their buildbot goes down. But if there's no error raised..
> well, an empty set is valid.

Seems to me that a 4xx/5xx HTTP code should be handled the same as a non-zero exit from a shell revset.

That brings up a related question, I guess: do we want to have a bit of an exit status protocol for shell revsets, where 0 is success, 1 means 'empty result' (like with hg commands), and > 2 indicates a 'true' error?

pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
Kevin R. Bullock



More information about the Mercurial-devel mailing list