Commit 5d57dfba authored by Laurent Peuch's avatar Laurent Peuch
Browse files


#!/usr/bin/env python3
import argh
from pathlib import Path
from urllib.parse import urlparse
from configparser import ConfigParser
from argh.decorators import named
def _grab_current_project_hgrc():
path = Path(".")
while path != Path("/"):
if (path / ".hg/hgrc").exists():
return path / ".hg/hgrc"
path = path.parent
raise Exception()
def _grab_current_project():
path = _grab_current_project_hgrc()
config = ConfigParser()
url = config["paths"]["default"]
# this handle both ssh://
# and patterns
url = urlparse(config["paths"]["default"])
url = f"https://{url.hostname}"
def mr_list():
parser = argh.ArghParser()
argh.add_commands(parser, [mr_list], namespace="mr")
if __name__ == '__main__':
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment