hg site extension
 

hg site: static repositories

Get it via hg clone http://draketo.de/proj/hgsite/

With hg site you can say goodbye to vendor lock-in.

Changes (full changelog)

(Arne Babenhauserheide)
2017-10-08: survive 4.x templater API changes tip

survive 4.x templater API changes

(Arne Babenhauserheide)
2017-08-19: workaround for 3.8 func.norepo API requirement

workaround for 3.8 func.norepo API requirement

(Arne Babenhauserheide)
2016-06-23: fix: forks were missing the site title

fix: forks were missing the site title

(Arne Babenhauserheide)
2016-06-23: fix: missing diffstat

fix: missing diffstat

Branches

(Arne Babenhauserheide)
releases: Added signature for changeset 0b6935620296 2014-03-14

Added signature for changeset 0b6935620296

(Arne Babenhauserheide)
default: survive 4.x templater API changes tip 2017-10-08

survive 4.x templater API changes

Tags

(Arne Babenhauserheide)
0.6.2: merge API fix for hg 2.8.2 releases 2014-03-14

merge API fix for hg 2.8.2

(Arne Babenhauserheide)
0.6.1: only write the bugslist and forks index files when they changed. releases 2014-03-14

only write the bugslist and forks index files when they changed.

(Arne Babenhauserheide)
0.6.0: merge: avoid partial localization, sort tags in reverse order, show releases 2014-03-14

merge: avoid partial localization, sort tags in reverse order, show branches only once, fix html errors, increased timeout to 60s and use ftp instead of FTPS, if the URL starts with ftp://.

(Arne Babenhauserheide)
0.5.3: merge default into releases releases 2014-02-10

merge default into releases

(Arne Babenhauserheide)
0.5.2: merge default into releases releases 2014-02-09

merge default into releases

(Arne Babenhauserheide)
0.5.1: merge default into releases releases 2014-02-09

merge default into releases

(Arne Babenhauserheide)
0.5: merge default into releases releases 2014-02-09

merge default into releases

(Arne Babenhauserheide)
0.4: merge default into releases for release. releases 2013-08-23

merge default into releases for release.

(Arne Babenhauserheide)
0.3: merge default into releases for release. releases 2013-04-13

merge default into releases for release.

(Arne Babenhauserheide)
0.2.2: FIX: Crashed if there were no prettify.js and prettify.css in the 2012-11-20

FIX: Crashed if there were no prettify.js and prettify.css in the top level of the repo.

(Arne Babenhauserheide)
0.2.1: resolved obsolete bugs. 2012-11-01

resolved obsolete bugs.

(Arne Babenhauserheide)
0.2: merged default into stable for release. releases 2012-10-30

merged default into stable for release.

(Arne Babenhauserheide)
0.1.4: works in 2.1, 2.3 and 2.4-rc 2012-10-28

works in 2.1, 2.3 and 2.4-rc

(Arne Babenhauserheide)
0.1.3: merge release releases 2011-11-24

merge release

(Arne Babenhauserheide)
0.1.2: merge default into release. releases 2011-11-24

merge default into release.

(Arne Babenhauserheide)
0.1.1: show the first 5 lines of the README instead of 3 (so people can put releases 2011-11-24

show the first 5 lines of the README instead of 3 (so people can put a description and a clone URL into it.

(Arne Babenhauserheide)
v0.1: new wish: settings in .hg/hgrc 2011-11-24

new wish: settings in .hg/hgrc

Readme

hg site: static repositories

Get it via hg clone http://draketo.de/proj/hgsite/

With hg site you can say goodbye to vendor lock-in.

Mission Statement

The goal of hg site is to enable convenient sharing of code over commodity servers which only offer FTP access and statically served files, while providing the same information as hg serve and full solutions like bitbucket, gitlab or notabug (naturally without the interactivity, but you can always clone the repo to interact).

Installation

  • Clone this repo.
    hg clone http://draketo.de/proj/hgsite/
  • add this to the [extensions] section in your ~/.hgrc
    site = path/to/staticsite.py
    if you have no such section, just add a line with content [extensions]. The extensions-section is below that line.

Usage

Create and Upload your Site: hg push [-f] --sitename "sitename" ftps://user:password@ftp.host.tld/path/to/dir

To make this more convenient, add the following path and alias to your .hg/hgrc:

[paths]
ftp = ftps://user:password@ftp.host.tld/path/to/dir
[alias]
pushsite = push --sitename "sitename" ftp

Then just use hg pushsite to upload.

That’s how the website at http://draketo.de/proj/hgsite/ is created.

If something goes wrong, use hg pushsite -f to force recreation and upload of all files.

Features

  • shows the history, branches, tags and bookmarks.
  • shows bugs tracked via the b-extension.
  • shows the readme.
  • shows forks which are defined as paths in .hg/hgrc - from any source hg supports.
  • uploads only hanged files (based on the time they were last modified), so uploads can be reasonably fast.
  • Supports FTP and FTPS. Use the latter if you can (just use URLs starting with ftps://).
  • static site (no vulnerabilities, little dependencies, high performance).

Thanks to the static http support of Mercurial, the clone and browse URLs are the same, so you can look at the site with your webbrowser or clone the repository with Mercurial using the same URL.

The fork detection allows tieing multiple platforms together: It tracks repositories from any source for which Mercurial can calculate incoming and outgoing changes. And since the bugtracking happens via the b-extension, your bugtracking follows your code wherever you go.

Basic Options

$ hg site --help
hg site [options] [folder]

Create a static copy of the repository and/or upload it to an FTP server.

use "hg help -e site" to show help for the site extension

options:

 -n --name VALUE         the repo name. Default: folder or last segment of the
                         repo-path.
 -u --upload VALUE       upload the repo to the given ftp host. Format:
                         user:password@host/path/to/dir
 -f --force              force recreating all commit files. Slow.
 -s --screenstyle VALUE  use a custom stylesheet for display on screen
 -p --printstyle VALUE   use a custom stylesheet for printing
    --mq                 operate on patch repository

use "hg -v help site" to show global options

Customization

To change the appearance of your site, create it once and then copy style.css and print.css from ._site/. Adapt them and use -s path/to/your/screen.css and -p path/to/your/print.css to use your adaptions.

Notes

Copyright 2012 till 2014 Arne Babenhauserheide, Licensed under GPLv2 or later.

Related: git2html