tests/test-hg-parseurl.py
author Philippe Pepiot <philippe.pepiot@logilab.fr>
Thu, 29 Sep 2016 10:16:34 +0200
changeset 30406 cff0f5926797
parent 28806 d26c4af27978
child 37713 11d128a14ec0
permissions -rw-r--r--
perf: add asv benchmarks Airspeed velocity (ASV) is a python framework for benchmarking Python packages over their lifetime. The results are displayed in an interactive web frontend. Add ASV benchmarks for mercurial that use contrib/perf.py extension that could be run against multiple reference repositories. The benchmark suite now includes revsets from contrib/base-revsets.txt with variants, perftags, perfstatus, perfmanifest and perfheads. Installation requires asv>=0.2, python-hglib and virtualenv This is part of PerformanceTrackingSuitePlan https://www.mercurial-scm.org/wiki/PerformanceTrackingSuitePlan

from __future__ import absolute_import, print_function

from mercurial import (
    hg,
)

def testparse(url, branch=[]):
    print('%s, branches: %r' % hg.parseurl(url, branch))

testparse('http://example.com/no/anchor')
testparse('http://example.com/an/anchor#foo')
testparse('http://example.com/no/anchor/branches', branch=['foo'])
testparse('http://example.com/an/anchor/branches#bar', branch=['foo'])
testparse('http://example.com/an/anchor/branches-None#foo', branch=None)
testparse('http://example.com/')
testparse('http://example.com')
testparse('http://example.com#foo')