Archive for the ‘Mercurial’ Category

Filed Under (Mercurial, Pylons, Python) by Marcin Kuźmiński on July-27-2010

It’s been some time, hg-app is still in rapid development.

DEMO: http://hg.python-works.com

TRACKER: http://bitbucket.org/marcinkuzminski/hg-app/issues

Since last time hg-app got:

  • Full permissions per repository system.
  • Yui float graphs
  • New gui
  • Database based settings and hooks
  • Huge number of bugfixes.

Below few screenshots of new hg-app gui.



Filed Under (Mercurial, Pylons) by Marcin Kuźmiński on June-7-2010

After some code fixups, and corrections i manage to set up a working demo of hg app.
This demo, has all functionality of hg app and will be updated during application life to current version.

Demo is available at http://hg.python-works.com

Any feedback is welcomed and can be posted to http://bitbucket.org/marcinkuzminski/hg-app/issues

Thank you !



Filed Under (Mercurial, Pylons, SqlAlchemy, Threads) by Marcin Kuźmiński on June-1-2010

Since, me and Lukasz fine tuned the vcs library i manage to setup a beta version of hg app. I was tired of the boring looks, and poor source code browsing capabilities of the hgwebdir.
So i started to write my own app, at the beginning it was just a simple hgwebdir wrapper, to pylons, now it’s fully standalone replacement. Including abilities to push/pull thrum the application.

Pylons based replacement for hgwebdir. Fully customizable,
with authentication, permissions. Based on vcs library.

  • has it’s own middleware to handle mercurial protocol request each request can
    be logged and authenticated +threaded performance unlikely to hgweb. Middleware recognises a mercurial protocol
    and skips any functionality for pure web request
  • mimics full functionality of hgwebdir including feeds,archives,diffs,raw-diffs,annotations,file history etc.
  • mako templates let’s you customize look and feel of the application.
    Possibly visual merge with your company systems
  • diffs annotations and source code all colored by pygments (see screenshots).
  • admin interface for performing user/permission managements as well as repository
    managements. Out of beta version should have fully customizable permission system, with
    private repos, and repo permissions
  • added cache with invalidation on push/repo managment for high performance and
    always upto date data.
  • rss / atom feeds
  • future support for git (thanks to vcs mercurial/git api should be 1:1
  • based on pylons 1.0 / sqlalchemy 0.6 /sqlite(possibly mysql/postgres thanks to sqlalchemy models)

Below are the beta version screenshots. Now I’m not good at designing webapps, so excuse me if you feel the look&feel to be to simple or bad looking.
It’s all i could come up with. Most of my expiration was taken from hgwebdir/bitbucket and github. I tried to take all best parts from all of them and combine into this app.
It’s still in beta but i think it’s production ready in this stage I’m using it for few weeks, and had no troubles or crashes with it. The code can be grabbed at bitbucket repo http://bitbucket.org/marcinkuzminski/hg-app/



Filed Under (Django, Mercurial, Pylons, Python) by Marcin Kuźmiński on May-2-2010

Since Me and Lukasz started this project a while ago, it’s time to announce that we shipped out first public Beta release.

It’s available on PyPi as “vcs”, so you can install it using PIP or EASY_INSTALL.

Simply run to download and install it.

easy_install vcs
pip install vcs

Lukasz made a nice documentation, and quick starts available here http://packages.python.org/vcs/

The vcs API:

Features

  • Common API for SCM backends (mercurial is the first and only one available right now)
  • Fetching repositories data lazily (performance and easy of use)
  • Simple caching mechanism so we don’t hit repo too often (so a refresh on a 2000 commit repo wont kill  the cpu)

Incoming

  • Django app for mercurial hgserve replacement – this is probably going to be a part of the vcs library
  • Pylons app for mercurial replacement – this is my little project which i finished roughly in 70% of functionality that hgwebdir does.
  • Command line client

Few things are worth mentioning.
The key point of vcs to have the same api for various SCM-s so mercurial,git,subversion(maybe others) will have
a same way for data access,objects structures and so on. Imagine how fast and simple you could extend an web app which uses
mercurial as a SCM to GIT, simply replace the repo path to git and all should work. Of Course there are some differences between git and mercurial
that could be handled in the same maner, and this is also simply handled by a private methods, specific for a SCM.

This is of course an open source project and any contributors are always welcomed.



Filed Under (Mercurial, Nginx) by Marcin Kuźmiński on November-15-2009

Today is a great day ;) i switched my repos from svn to mercurial.
I was still thinking about GIT but there where three key points that made me choose mercurial

Cons: it’s slower than GIT ( but who cares :D )

So after installing mercurial and moving my svn repos with history with hgsvn ( which can also do push to svn )
I started to setup easy access to the repository using nginx. I’ll show you how to setup an SSL http based repository to do PUSH/PULL/CLONE what ever.

Firstly we have to make self signed ssl certificates.
I found on of the easiest tutorials available you can find it here: http://www.akadia.com/services/ssh_test_certificate.html

OK when we have the ssl certificates for our server. Put it somewhere on the server so nginx can access it.
We have to setup a new virtual host for nginx that will only do ssl connections
and have basic auth additionally.

Here’s the example config:

server {
    listen          443;
    server_name     hg.yourserver.com;
    ssl    on;
    ssl_certificate    /home/ssl_certs/hg_cert.crt;
    ssl_certificate_key     /home/ssl_certs/hg_cert.key;
    access_log      /var/log/nginx/hg.log;
    auth_basic      "mercurial server";
    auth_basic_user_file    /etc/nginx/.htpasswd;

    location / {
        proxy_pass      http://127.0.0.1:8001;
        #here's where the hg server runs
        include         /etc/nginx/proxy.conf;
    }
}

Few thing to notice.
.htpasswd file has to be in a format <username>:<cryptPassword> if you don’t have apache
installed you can use my password generator for generating crypt password. This username
and password will be used to do pull/push from console and eclipse.
Another important thing is that when you run hg serve you must specify the -a 127.0.0.1 option which is
for the address the mercurial server runs. Hg serve default is to start at all interfaces
so you have this port open outside and your ssl/passwd protection is for nothing…

I run my using hg serve –webdir-conf=/etc/hg/hgweb.conf -d -p 8001 -a 127.0.0.1

The hgweb.conf should be with

push_ssl = false
#since nginx is doing the SSL
allow_push = * #NGINX  is doing the auth
style = gitweb

O and one more thing remember that your repo should be accessible to hg serv.
I made a mistake and run hg serve as www-data and my repo was to my home user,
and i had internal server error when trying to do push to server.

So now you can have your repo via http with SSL and nginx authentication.