Mercurial > hg > silvermirror
comparison 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 |
comparison
equal
deleted
inserted
replaced
0:abb358e2434c | 1:9b139702a8f9 |
---|---|
1 #!/usr/bin/env python | |
2 """ | |
3 stub for the hg backend of silvermirror | |
4 """ | |
5 | |
6 import os | |
7 from mercurial import commands, hg, ui | |
8 | |
9 def update(host, path): | |
10 """ | |
11 get changes from host on path | |
12 """ | |
13 ui = ui.ui() | |
14 try: | |
15 repo = hg.repository(ui, path) | |
16 command = commands.pull | |
17 except mercurial.repo.RepoError: | |
18 repo = hg.repository(ui, 'ssh://%s/%s' % (host, path)) | |
19 command = commands.clone |