This is the milestone that I wanted to reach after the last couple of blog posts.
I wanted to have a local hg server with few of the l10n repositories and with pushlog to be able to test an HgPoller. Let's see if this is the last one of this series of posts.
NOTE: Remember to export PYTHONPATH=/repos/hghooks/ - You would get an error like this when trying to push if not set: "abort: pretxnchangegroup.a_singlehead hook is invalid (import of "mozhghooks.single_head_per_branch" failed)". In fact, I have put it on my .bashrc
NOTE2: It is not suggested to use "allow_push = *" and "push_ssl = false" since you allow everyone who can reach your server to commit changes
I wanted to have a local hg server with few of the l10n repositories and with pushlog to be able to test an HgPoller. Let's see if this is the last one of this series of posts.
What I did on the server side:
- cd /var/hg/l10n-central
- hg clone http://hg.mozilla.org/l10n-central/af
- hg clone http://hg.mozilla.org/l10n-central/de
- replaced the .hg/hgrc of both repos with what was explained on my first post plus adding the push_ssl and allow_push values:
# the a_ and z_ prefixes are for ordering:
# any hooks which can veto an action (require-singlehead) should be run before
# hooks which make permanent logs (record-changeset-info)
[hooks]
pretxnchangegroup.a_singlehead = python:mozhghooks.single_head_per_branch.hook
pretxnchangegroup.z_linearhistory = python:mozhghooks.pushlog.log
[web]
push_ssl = false
allow_push = *
templates = /repos/hg_templates
style = gitweb_mozilla
[extensions]
pushlog-feed = /repos/hgpoller/pushlog-feed.py
buglink = /repos/hgpoller/buglink.py
hgwebjson = /repos/hgpoller/hgwebjson.py - /var/hg$ hg serve --webdir-conf hgweb.config
NOTE: Remember to export PYTHONPATH=/repos/hghooks/ - You would get an error like this when trying to push if not set: "abort: pretxnchangegroup.a_singlehead hook is invalid (import of "mozhghooks.single_head_per_branch" failed)". In fact, I have put it on my .bashrc
NOTE2: It is not suggested to use "allow_push = *" and "push_ssl = false" since you allow everyone who can reach your server to commit changes
What I did on the client side:
- hg clone http://localhost:8000/af
- make some changes on the checked out repo
- add "default-push = http://localhost:8000/af" under [paths] in my checked out repo's .hg/hgrc file
- hg commit -m "message"
- hg push
To check the web interface and/or the pushlog of that repo browse to:
- http://localhost:8000/af
- http://localhost:8000/af/pushlog
My wish list:
I would like to be able to have the URL to look like:- http://localhost:8000/l10n-central/af
- http://localhost:8000/releases/l10n-mozilla-1.9.1/af
You'll need the subdirs, as those denote the branches in the hgpoller.
ReplyDeleteLooking at the doc you referenced in your previous post, did you try out
[web]
style = gitweb
?
You should have a mozilla-central clone next to your l10n-central dir, too, our setups don't support having code on different hg servers.
Actually, gitweb_mozilla should probably be ok.
ReplyDeleteMaybe put the web config back into a separate file and run hg serve from the parent of the hg repo dirs?
This is what I have which is not mentioned on the blog post:
ReplyDelete$> cat /var/hg/hgweb.config
[collections]
l10n-central/ = l10n-central/
mozilla-central/ = mozilla-central/
[web]
style = gitweb_mozilla
^^ not sure if this last [web] section applies
$> ls /var/hg/l10n-central/
af de test
$> ls /var/hg/mozilla-central/
mozilla-central
^^ maybe I should have mozilla-central one level above and remove the collections's item for mozilla-central