Skip to content
Snippets Groups Projects
Commit b8b47fee authored by Georges Racinet's avatar Georges Racinet
Browse files

Merged changes for source install and git quieting from 'default'

parents 657db927 970fb3c5
No related branches found
No related tags found
No related merge requests found
......@@ -11,4 +11,5 @@
.pytest_cache/
.coverage
.coverage.*
htmlcov/
include install-requirements.txt
%include /path/to/clone/of/py-heptapod/required.hgrc
[heptapod]
repositories-root=/path/to/repositories
gitlab-shell=/path/to/clone/of/gitlab-shell
[logging]
# see https://dev.heptapod.net/heptapod/hgext-loggingmod/blob/branch/default/README.md
# Heptapod still being in its infancy, a rather verbose
# default level is appropriate
level = info
file = /tmp/mercurial.log
......@@ -31,4 +31,6 @@
repo.ui.note("Heptapod mirror starting, target is %r" % dest)
push = cmdutil.findcmd('push', commands.table)[1][0]
quiet = ui.quiet
ui.quiet = True
push(ui, repo, dest=dest, force=True)
......@@ -34,4 +36,5 @@
push(ui, repo, dest=dest, force=True)
ui.quiet = quiet
# command.push converts pushoperation.cgresult into a boolean, with True
# meaning a problem occurred, and False being the normal condition.
# It does it like so:
......
[extensions]
heptapod=
hggit=
evolve=
topic=
loggingmod =
[logging]
# see https://dev.heptapod.net/heptapod/hgext-loggingmod/blob/branch/default/README.md
# it is essential for proper GitLab operation that nothing ends up on
# stderr during merges, otherwise it counts as an error.
file = /tmp/mercurial.log
[hooks]
# the heptapod_hooks package gets installed by
# Heptapod's version of the hg-git Python distribution
pretxnclose.heptapod_sync=python:heptapod.hooks.git_sync.mirror
pretxnopen.heptapod_check_write=python:heptapod.hooks.perm.check_write
pretxnclose.heptapod_check_publish=python:heptapod.hooks.check_publish.check_publish
# ordering: higher has more priority. We don't want to rely
# on the order of registration because of possible overrides
# (default value, which most user hooks would have is 0)
# permissions or sanity checks go first
priority.pretxnclose.heptapod_check_publish = 100
# internal git sync should be last, and after any
# user registered ones by default
priority.pretxnclose.heptapod_sync = -100
[experimental]
hg-git.export-named-branches = yes
single-head-per-branch = yes
obshashrange = yes
topic.publish-bare-branch = yes
[web]
push_ssl = no
allow_push = heptapod-write, heptapod-publish
allow_publish = heptapod-publish
[phases]
publish = false
[git]
blockdotgit = false
......@@ -25,9 +25,12 @@
def test_missing_conf_file(tmpdir):
hgrc_path = tmpdir.join('heptapod.hgrc')
hgrc_path.write('\n'.join(("[extensions]", "evolve=", "topic=", "")))
with pytest.raises(error.Abort) as exc_info:
HgServe(conf_path=str(tmpdir.join('does-not-exist')))
assert 'not found' in exc_info.value.args[0]
......@@ -28,9 +31,23 @@
with pytest.raises(error.Abort) as exc_info:
HgServe(conf_path=str(tmpdir.join('does-not-exist')))
assert 'not found' in exc_info.value.args[0]
def test_missing_secondary_conf_file(tmpdir):
"""Only the first HGRC in path is required."""
hgrc = tmpdir.join('hgrc')
repos = tmpdir.join('repositories')
hgrc.write('\n'.join(('[heptapod]\n',
'repositories-root=' + str(repos),
)))
hgs = HgServe(conf_path=':'.join((
str(hgrc),
str(tmpdir.join('does-not-exist'))
)))
assert hgs.repos_root == str(repos)
def make_hgserve(repo_root):
"""Return a minimal instance of Hgserve for given repository root."""
base_ui = make_ui(None, config=dict(
......
......@@ -86,10 +86,11 @@
extensions.loadall(self.ui)
extensions.populateui(self.ui)
if conf_path is not None:
if not os.path.exists(conf_path):
raise error.Abort(_('config file %s not found!') % conf_path)
logger.info("Loading configuration from %r", conf_path)
self.ui.readconfig(conf_path, trust=True)
for i, rcf in enumerate(conf_path.split(':')):
if i == 0 and not os.path.exists(rcf):
raise error.Abort(_('config file %s not found!') % rcf)
logger.info("Loading configuration from %r", rcf)
self.ui.readconfig(rcf, trust=True)
root = self.ui.config('heptapod', 'repositories-root')
if root is None:
......
......@@ -13,6 +13,7 @@
long_description=open('README.md').read(),
keywords='hg mercurial heptapod gitlab',
license='GPLv2+',
package_data=dict(heptapod=['*.hgrc']),
packages=['heptapod', 'hgext3rd'],
install_requires=install_req,
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment