how to poll hg repo in python

Rathnamachary G rathnamachary at gmail.com
Sat May 9 22:44:47 CDT 2015


By script how do we get return value if repo changes happen(i.e..check-in
happen)

On Sat, May 9, 2015 at 9:57 PM, Gregory Szorc <gregory.szorc at gmail.com>
wrote:

> On Thu, May 7, 2015 at 5:25 AM, Rathnamachary G <rathnamachary at gmail.com>
> wrote:
>
>>
>> Hi,
>> I want to poll hg repository by python without using buildbot tool is it
>> possible?
>> i have tried below, but, it is always going into if condition only
>> with/without checkin, please help me. if anything is there.
>>
>> _____________________repo.py______________________________
>> from buildbot.changes.hgpoller import HgPoller
>>
>> while 1:
>>        ret1=HgPoller('repo', workdir = '/path', pollInterval = 5,
>> project='name')
>>        ret=ret1.poll()
>>         if ret:
>>                 print ret
>>                 print 'if'
>>         else:
>>                 print ret
>>                 print 'else'
>>
>
> Mercurial 3.4 has the beginning of a JSON API on all hgweb commands. You
> can use any Python HTTP library (I recommend "requests") and hit a URL like
> http://selenic.com/repo/hg/json-rev/tip. If the "node" of the "tip"
> changeset changes, the repo has been updated.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20150510/858ed9b2/attachment.html>


More information about the Mercurial-devel mailing list