Archive for the ‘Mercurial’ Category

Pretty colors: Syntax Highlighting in Mercurial

Sunday, November 18th, 2007

I recently switched my personal revision control system from subversion to mercurial. One of the great things about mercurial is the built-in web interface, but I missed the syntax highlighting that’s available in interfaces such as ViewVC.

I’ve written a mercurial extension that applies pygments

view. This extension is now available in the main mercurial repo.

To enable it, install pygments and add the following entry to hgrc:

[extension]
hgext.highlight =

An example of the output.

Thanks to micha who wrote an initial patch. black jack betting strategyfree online video pokerbackgammon gambling,online backgammon gamblinghow to play video pokervideo poker practicefree baccarat game,baccarat game,baccarat casino gametournament backgammoninternet casino gamefull pay video pokerno deposit bonus online casinofree slots,free slots game,free on line slotsbaccarat rulefree black jack gamecraps online gamevirtual casino gamblingfree video poker downloadsblackjack gambling game,blackjack gambling,online blackjack gamblingblackjack casino gameno deposit free money casinocasino link online suggestreal money backgammonplay free casino slotshow to play backgammon,instructions to play backgammon,play backgammon online freevideo poker tournamentfree on line slotsblack jack downloadon line casino wageringfree cash casinoplay free online slotslearn to play crapsdouble bonus video pokerbest online casino bonusinternet casino gambling game,internet casino gambling,internet casino gambling ukonline casino gambling,gambling casino online bonus,online casino online gamblingfree backgammon downloaddownload casino gamevideo poker doublejacks or better video pokerno download video pokeronline black jack gameonline casino gambling sitebaccarat the internet casino game,casino baccarat,virtual online casino gambling baccaratfree online black jack gameonline baccarathow to win at roulettedeuces wild video pokerfind online casinole casinoblack jack regolenouveau casino bonus sans depot

Serving mercurial with mod_wsgi

Monday, September 17th, 2007

Here’s a quick and easy recipe for serving a mercurial repository with mod_wsgi.

  1. Create a file called hgwebdir.wsgi with these contents:

    from mercurial.hgweb.request import wsgiapplication
    from mercurial.hgweb.hgwebdir_mod import hgwebdir
    
    def make_web_app():
        return hgwebdir("/path/to/hgweb.config")
    
    application = wsgiapplication(make_web_app)
    
  2. Add it to the apache configuration:

    WSGIScriptAlias /hg /path/to/hgwebdir.wsgi

  3. [optional] To make sure nobody modifies your repository via the http interface, add ‘deny_push = *’ to the ‘[web]‘ group of hgweb.config.

Hopefully this page will save the next person a few minutes of searching.