# HG changeset patch # User Jeff Hammel # Date 1320887162 28800 # Node ID d69041957c0e24f89b1259dc099a2802c0095e6f # Parent 64f89df1b9668ace3f95e2d028d780f078ba3ff3 more stubbing diff -r 64f89df1b966 -r d69041957c0e fetch.py --- a/fetch.py Wed Nov 09 16:58:03 2011 -0800 +++ b/fetch.py Wed Nov 09 17:06:02 2011 -0800 @@ -84,6 +84,10 @@ ### VCS fetchers using executable import subprocess +try: + from subprocess import check_call as call +except ImportErorr: + raise # we need check_call, kinda class VCSFetcher(Fetcher): def __init__(self, url, export=True): @@ -99,9 +103,17 @@ """checkout a mercurial repository""" type = 'hg' + def __init__(self, url, export=True): + VCSFetcher.__init__(self, url, export=True) + self.hg = which('hg') + def __call__(self, dest): if os.path.exits(dest): assert os.path.isdir(dest) and os.path.exists(os.path.join(dest, '.hg')) + call([self.hg, 'pull', self.url], cwd=dest) + call([self.hg, 'update'], cwd=dest) + else: + pass raise NotImplementedError("TODO! Sorry!") fetchers.append(HgFetcher)