view silvermirror/hg.py @ 1:9b139702a8f9

use a real backend architecture with an inteface and vastly simplify unify.py
author k0s <k0scist@gmail.com>
date Sat, 26 Sep 2009 23:36:42 -0400
parents
children 0d9094bb98b0
line wrap: on
line source

#!/usr/bin/env python
"""
stub for the hg backend of silvermirror
"""

import os
from mercurial import commands, hg, ui

def update(host, path):
    """
    get changes from host on path
    """
    ui = ui.ui()
    try: 
        repo = hg.repository(ui, path)
        command = commands.pull
    except mercurial.repo.RepoError:
        repo = hg.repository(ui, 'ssh://%s/%s' % (host, path))
        command = commands.clone