From f108f5a0fb0984c0daccd8be72ea0ffa309b3fff Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Tue, 17 Nov 2009 09:47:44 -0500 Subject: Use unicode_output=False in some Darcs._u_invoke_client() calls. This avoids the following error: ====================================================================== ERROR: Should get file contents as committed to specified revision. ---------------------------------------------------------------------- Traceback (most recent call last): File ".../libbe/vcs.py", line 860, in test_revision_file_contents_as_committed full_path, revision) File ".../libbe/vcs.py", line 339, in get_file_contents contents = self._vcs_get_file_contents(relpath,revision,binary=binary) File ".../libbe/darcs.py", line 122, in _vcs_get_file_contents status,output,error = self._u_invoke(args, stdin=major_patch) File ".../libbe/vcs.py", line 488, in _u_invoke raise CommandError(args, status, stdout, stderr) CommandError: Command failed (2): patch: **** Only garbage was found in the patch input. while executing ['patch', '--reverse', 'a/text'] After adding the unicode_output=False lines, I adjusted the VCS._u_invoke_client() definition to pass all it's kwargs automatically through to VCS._u_invoke(). To make this simpler and more consistent, I renamed the "directory" option to "cwd", and adjusted *._u_invoke() calls appropriately in several VCS backends. --- libbe/darcs.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'libbe/darcs.py') diff --git a/libbe/darcs.py b/libbe/darcs.py index 9115886..6bf0119 100644 --- a/libbe/darcs.py +++ b/libbe/darcs.py @@ -60,7 +60,7 @@ class Darcs(vcs.VCS): return None return os.path.dirname(darcs_dir) def _vcs_init(self, path): - self._u_invoke_client("init", directory=path) + self._u_invoke_client("init", cwd=path) def _vcs_get_user_id(self): # following http://darcs.net/manual/node4.html#SECTION00410030000000000000 # as of June 29th, 2009 @@ -107,10 +107,12 @@ class Darcs(vcs.VCS): # Darcs versions < 2.0.0pre2 lack the "show contents" command status,output,error = self._u_invoke_client( \ - "diff", "--unified", "--from-patch", revision, path) + "diff", "--unified", "--from-patch", revision, path, + unicode_output=False) major_patch = output status,output,error = self._u_invoke_client( \ - "diff", "--unified", "--patch", revision, path) + "diff", "--unified", "--patch", revision, path, + unicode_output=False) target_patch = output # "--output -" to be supported in GNU patch > 2.5.9 -- cgit