Mercurial > hg > silvermirror
view silvermirror/unison.py @ 2:0d9094bb98b0
adding function to return all hg repos on a path
author | k0s <k0scist@gmail.com> |
---|---|
date | Fri, 02 Oct 2009 19:00:46 -0400 |
parents | 9b139702a8f9 |
children | 743c920bc041 |
line wrap: on
line source
""" unison backend for silvermirror """ import pexpect from interface import Reflector class unison(Reflector): def sync(self, host, resource, ignore=(), password=None, test=False): command = ['unison', '-auto', '-batch', resource, 'ssh://%s/%s' % (host, resource)] for i in ignore: command.extend(('-ignore', "'Name %s'" % i)) command = ' '.join(command) print command # XXX debug -- should go to logging if not test: child = pexpect.spawn(command, timeout=36000, maxread=1) child.expect('password: ') child.sendline(password[host]) print child.read() # XXX -> logging