1
2 """A VCS-interface to Mercurial"""
3
4 from PyFoam.Error import warning,error,notImplemented
5
6 from GeneralVCSInterface import GeneralVCSInterface
7
8 from os import path as opath
9 import subprocess
10 import os
11
13 """\
14 The interface class to git
15
16 Only a partial implementation (As much as the BuildHelper needs)"""
17
18 - def __init__(self,
19 path,
20 init=False):
25
26
28 oldDir=os.getcwd()
29 os.chdir(path)
30 result=self.executeWithOuput("git rev-parse --show-toplevel")
31 os.chdir(oldDir)
32 return result
33
36
39
40 - def update(self,
41 timeout=None):
42 ok=self.doInPath(subprocess.call,["git","pull"])
43 return ok==0
44