aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/darcs.py
diff options
context:
space:
mode:
authorGianluca Montecchi <gian@grys.it>2009-10-07 20:41:49 +0200
committerGianluca Montecchi <gian@grys.it>2009-10-07 20:41:49 +0200
commitc65661ce0bcacf67169faf3f62d495a1e8269aa8 (patch)
treef803a1417278840c938e4585b4b76bfbb9fd74fe /libbe/darcs.py
parent828721071e6283fbf7397ad7ad4b98c5d6ee49bc (diff)
downloadbugseverywhere-c65661ce0bcacf67169faf3f62d495a1e8269aa8.tar.gz
Updated to trunk
Diffstat (limited to 'libbe/darcs.py')
-rw-r--r--libbe/darcs.py26
1 files changed, 14 insertions, 12 deletions
diff --git a/libbe/darcs.py b/libbe/darcs.py
index 16005f2..9115886 100644
--- a/libbe/darcs.py
+++ b/libbe/darcs.py
@@ -40,8 +40,10 @@ class Darcs(vcs.VCS):
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 :
@@ -95,20 +97,20 @@ class Darcs(vcs.VCS):
def _vcs_get_file_contents(self, path, revision=None, binary=False):
if revision == None:
return vcs.VCS._vcs_get_file_contents(self, path, revision,
- binary=binary)
+ binary=binary)
else:
- try:
- return self._u_invoke_client("show", "contents", "--patch", revision, path)
- except vcs.CommandError:
+ if self.parsed_version[0] >= 2:
+ status,output,error = self._u_invoke_client( \
+ "show", "contents", "--patch", revision, path)
+ return output
+ else:
# Darcs versions < 2.0.0pre2 lack the "show contents" command
- status,output,error = self._u_invoke_client("diff", "--unified",
- "--from-patch",
- revision, path)
+ status,output,error = self._u_invoke_client( \
+ "diff", "--unified", "--from-patch", revision, path)
major_patch = output
- status,output,error = self._u_invoke_client("diff", "--unified",
- "--patch",
- revision, path)
+ status,output,error = self._u_invoke_client( \
+ "diff", "--unified", "--patch", revision, path)
target_patch = output
# "--output -" to be supported in GNU patch > 2.5.9