Mercurial socket interface
Benjamin Pollack
benjamin at bitquabit.com
Sun Oct 4 16:55:41 UTC 2009
On Sun, 2009-10-04 at 08:34 -0600, Bill Barry wrote:
> Most [all?] of these issues could be overcome with a combination of:
> 1. A socket interface running a daemon-ized version of Hg.
> 2. A library in the user's language of choice for interacting with the
> socket.
You could implement 100% of the read operations you'd actually want just
by giving hg serve some JSON templates and adding a page for showing the
status of local files in the repositories. That's easy, reuses as much
of the original machinery as possible, is fully backwards-compatible,
would potentially allow native browsers for remote repositories, and
would be trivially leveraged from any environment with a JSON
reader--which these days is basically all of them. Having to fire up hg
via the command line for editing the repository (pull, push, update, and
commit), which happens rarely, and which users expect to take a moment,
seems quite reasonable. Besides, the team's been extremely proactive in
ensuring that the Mercurial command line output *is* stable,
specifically so that it can be reliably parsed by third-party programs,
so this approach would seem to give you the best of both worlds: fast
and easy-to-parse data access with no licensing issues.
--Benjamin
More information about the Mercurial-devel
mailing list