diff fetch.py @ 19:d69041957c0e

more stubbing
author Jeff Hammel <jhammel@mozilla.com>
date Wed, 09 Nov 2011 17:06:02 -0800
parents 64f89df1b966
children 738d84b4de52
line wrap: on
line diff
--- 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)