From: W. Trevor King Date: Tue, 6 Oct 2009 10:47:10 +0000 (-0400) Subject: Oops, fixed return typo in libbe.darcs.Darcs._vcs_get_file_contents() X-Git-Tag: 1.0.0~60^2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5ccc639e7c04abc97db15eb15677a256e9400b44;p=be.git Oops, fixed return typo in libbe.darcs.Darcs._vcs_get_file_contents() For self.parsed_version[0] >= 2, was returning the entire output of ._u_invoke_client() (status, output, and error). Now it just returns the output, which is what we want. This fixes Chris' failed test: ====================================================================== FAIL: Should get file contents as committed to specified revision. ---------------------------------------------------------------------- Traceback (most recent call last): File "libbe/vcs.py", line 852, in test_revision_file_contents_as_committed self.test_contents['rev_1'], committed_contents) AssertionError: 'Lorem ipsum' != (0, 'Lorem ipsum', '') ---------------------------------------------------------------------- --- diff --git a/libbe/darcs.py b/libbe/darcs.py index a46403c..9115886 100644 --- a/libbe/darcs.py +++ b/libbe/darcs.py @@ -97,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: if self.parsed_version[0] >= 2: - return self._u_invoke_client("show", "contents", "--patch", revision, path) + 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