solovyov.net

Mercurial in complex workflows

Mercurial in complex workflows

Mercurial

in complex workflows

droplets.svg

Who I am

Alexander Solovyov

Traditional workflow

What's wrong

Where to look

World has invented a great model for developer interaction:

Open Source

Open Source

Workflow

What's the point

DVCS

Mercurial

How it applies

Branching

hg serve

project> hg serve
listening at http://hostname:8000/ (bound to *:8000)

# this requires zeroconf extension enabled
~> hg paths
zc-hostname-project = http://192.168.1.2:8000/

Revision sets

project> hg log -r 'ancestors(branchname) - ancestors(master)'
project> hg log -r 'bookmark() - ancestors(master)' --template '{bookmarks}\n'

Transplant

Other stuff

Mercurial API

Bookmarks pushing

def bookpush(orig, ui, repo, dest=None, **opts):
    if '.' in opts.get('bookmark', ()) and repo._bookmarkcurrent:
        n = opts['bookmark'].index('.')
        opts['bookmark'][n] = repo._bookmarkcurrent
    return orig(ui, repo, dest, **opts)

def uisetup(ui):
    extensions.wrapcommand(commands.table, 'push', bookpush)

And suddenly you don't need to copy-paste:

> hg push -B . # instead of "-B bookmark-name"

What do we have

Making life easier

Automate and structure it

Questions

It's the time for them. :)