annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
9b139702a8f9 use a real backend architecture with an inteface and vastly simplify unify.py
k0s <k0scist@gmail.com>
parents:
diff changeset
1 #!/usr/bin/env python
9b139702a8f9 use a real backend architecture with an inteface and vastly simplify unify.py
k0s <k0scist@gmail.com>
parents:
diff changeset
2 """
9b139702a8f9 use a real backend architecture with an inteface and vastly simplify unify.py
k0s <k0scist@gmail.com>
parents:
diff changeset
3 stub for the hg backend of silvermirror
9b139702a8f9 use a real backend architecture with an inteface and vastly simplify unify.py
k0s <k0scist@gmail.com>
parents:
diff changeset
4 """
9b139702a8f9 use a real backend architecture with an inteface and vastly simplify unify.py
k0s <k0scist@gmail.com>
parents:
diff changeset
5
9b139702a8f9 use a real backend architecture with an inteface and vastly simplify unify.py
k0s <k0scist@gmail.com>
parents:
diff changeset
6 import os
9b139702a8f9 use a real backend architecture with an inteface and vastly simplify unify.py
k0s <k0scist@gmail.com>
parents:
diff changeset
7 from mercurial import commands, hg, ui
9b139702a8f9 use a real backend architecture with an inteface and vastly simplify unify.py
k0s <k0scist@gmail.com>
parents:
diff changeset
8
9b139702a8f9 use a real backend architecture with an inteface and vastly simplify unify.py
k0s <k0scist@gmail.com>
parents:
diff changeset
9 def update(host, path):
9b139702a8f9 use a real backend architecture with an inteface and vastly simplify unify.py
k0s <k0scist@gmail.com>
parents:
diff changeset
10 """
9b139702a8f9 use a real backend architecture with an inteface and vastly simplify unify.py
k0s <k0scist@gmail.com>
parents:
diff changeset
11 get changes from host on path
9b139702a8f9 use a real backend architecture with an inteface and vastly simplify unify.py
k0s <k0scist@gmail.com>
parents:
diff changeset
12 """
9b139702a8f9 use a real backend architecture with an inteface and vastly simplify unify.py
k0s <k0scist@gmail.com>
parents:
diff changeset
13 ui = ui.ui()
9b139702a8f9 use a real backend architecture with an inteface and vastly simplify unify.py
k0s <k0scist@gmail.com>
parents:
diff changeset
14 try:
9b139702a8f9 use a real backend architecture with an inteface and vastly simplify unify.py
k0s <k0scist@gmail.com>
parents:
diff changeset
15 repo = hg.repository(ui, path)
9b139702a8f9 use a real backend architecture with an inteface and vastly simplify unify.py
k0s <k0scist@gmail.com>
parents:
diff changeset
16 command = commands.pull
9b139702a8f9 use a real backend architecture with an inteface and vastly simplify unify.py
k0s <k0scist@gmail.com>
parents:
diff changeset
17 except mercurial.repo.RepoError:
9b139702a8f9 use a real backend architecture with an inteface and vastly simplify unify.py
k0s <k0scist@gmail.com>
parents:
diff changeset
18 repo = hg.repository(ui, 'ssh://%s/%s' % (host, path))
9b139702a8f9 use a real backend architecture with an inteface and vastly simplify unify.py
k0s <k0scist@gmail.com>
parents:
diff changeset
19 command = commands.clone