Oops, fixed return typo in libbe.darcs.Darcs._vcs_get_file_contents()
authorW. Trevor King <wking@drexel.edu>
Tue, 6 Oct 2009 10:47:10 +0000 (06:47 -0400)
committerW. Trevor King <wking@drexel.edu>
Tue, 6 Oct 2009 10:47:10 +0000 (06:47 -0400)
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', '')
----------------------------------------------------------------------

libbe/darcs.py

index a46403c33ebe0de165f88b174fe2c7a718bb60c9..91158860f14e0a32d48673ee5a5968ded1806b74 100644 (file)
@@ -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