_project_name = None
_tmp_project = False
_arch_paramdir = os.path.expanduser("~/.arch-params")
- def _vcs_help(self):
- status,output,error = self._u_invoke_client("--help")
+ def _vcs_version(self):
+ status,output,error = self._u_invoke_client("--version")
return output
def _vcs_detect(self, path):
"""Detect whether a directory is revision-controlled using Arch"""
name = "bzr"
client = "bzr"
versioned = True
- def _vcs_help(self):
- status,output,error = self._u_invoke_client("--help")
+ def _vcs_version(self):
+ status,output,error = self._u_invoke_client("--version")
return output
def _vcs_detect(self, path):
if self._u_search_parent_directories(path, ".bzr") != None :
name="darcs"
client="darcs"
versioned=True
- def _vcs_help(self):
- status,output,error = self._u_invoke_client("--help")
+ def _vcs_version(self):
+ status,output,error = self._u_invoke_client("--version")
+ num_part = output.split(" ")[0]
+ self.parsed_version = [int(i) for i in num_part.split(".")]
return output
def _vcs_detect(self, path):
if self._u_search_parent_directories(path, "_darcs") != None :
return vcs.VCS._vcs_get_file_contents(self, path, revision,
binary=binary)
else:
- try:
+ if self.parsed_version[0] >= 2:
return self._u_invoke_client("show", "contents", "--patch", revision, path)
- except vcs.CommandError:
+ else:
# Darcs versions < 2.0.0pre2 lack the "show contents" command
status,output,error = self._u_invoke_client("diff", "--unified",
name="git"
client="git"
versioned=True
- def _vcs_help(self):
- status,output,error = self._u_invoke_client("--help")
+ def _vcs_version(self):
+ status,output,error = self._u_invoke_client("--version")
return output
def _vcs_detect(self, path):
if self._u_search_parent_directories(path, ".git") != None :
name="hg"
client="hg"
versioned=True
- def _vcs_help(self):
- status,output,error = self._u_invoke_client("--help")
+ def _vcs_version(self):
+ status,output,error = self._u_invoke_client("--version")
return output
def _vcs_detect(self, path):
"""Detect whether a directory is revision-controlled using Mercurial"""
self._duplicateBasedir = None
self._duplicateDirname = None
self.encoding = encoding
-
- def _vcs_help(self):
+ self.version = self._get_version()
+ def _vcs_version(self):
"""
- Return the command help string.
- (Allows a simple test to see if the client is installed.)
+ Return the VCS version string.
"""
- pass
+ return "0.0"
def _vcs_detect(self, path=None):
"""
Detect whether a directory is revision controlled with this VCS.
specified revision does not exist.
"""
return None
- def installed(self):
+ def _get_version(self):
try:
- self._vcs_help()
- return True
+ ret = self._vcs_version()
+ return ret
except OSError, e:
if e.errno == errno.ENOENT:
- return False
+ return None
+ else:
+ raise OSError, e
except CommandError:
- return False
+ return None
+ def installed(self):
+ if self.version != None:
+ return True
+ return False
def detect(self, path="."):
"""
Detect whether a directory is revision controlled with this VCS.