aiohglib 1.5

Creator: codyrutscher

Last updated:

Add to Cart

Description:

aiohglib 1.5

aiohglib
The aiohglib is an asynchronous variant of hglib, which is library with a fast, convenient interface to Mercurial. It uses Mercurial's command server for communication with hg.
The code itself takes advantage of asyncio library and async/await syntax.
Another difference against standard hglib is suport for timezones and changesets details like p1, p2 and extras.
Basic usage
import asyncio
import aiohglib

async def main():
async with aiohglib.open(path) as client:
log = await client.log(revrange="tip")
print(log)

# Depending on your Python version you need to run one of those:

# Python 3.7 or newer
asyncio.run(main())

# Python 3.6
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close()

# Python 3.6 on Windows
loop = asyncio.ProactorEventLoop()
loop.run_until_complete(main())
loop.close()

Dependencies

Python 3.6
pytz
chardet (optional)

Changelog
1.5

Changed string decoding and codec detection to be more safe.

1.4

Fixed await syntax in client.py
Fixed redundant __bool__ in util.py
Optional detection of encoding for changeset's author and description via chardet module
Optional safe_template is now not used by default

Licence
MIT
Contact
Michal Šiška michal.515k4@gmail.com

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.