aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/git.py
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2009-11-17 09:47:44 -0500
committerW. Trevor King <wking@drexel.edu>2009-11-17 09:47:44 -0500
commitf108f5a0fb0984c0daccd8be72ea0ffa309b3fff (patch)
tree674a4de9a5f63c5e67ed07b15a76f4b1fcedf398 /libbe/git.py
parent2a1bca807d4b94610924343169c813a9f7868147 (diff)
downloadbugseverywhere-f108f5a0fb0984c0daccd8be72ea0ffa309b3fff.tar.gz
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.
Diffstat (limited to 'libbe/git.py')
-rw-r--r--libbe/git.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/libbe/git.py b/libbe/git.py
index 628f9b9..781a278 100644
--- a/libbe/git.py
+++ b/libbe/git.py
@@ -50,12 +50,12 @@ class Git(vcs.VCS):
if os.path.isdir(path) != True:
path = os.path.dirname(path)
status,output,error = self._u_invoke_client("rev-parse", "--git-dir",
- directory=path)
+ cwd=path)
gitdir = os.path.join(path, output.rstrip('\n'))
dirname = os.path.abspath(os.path.dirname(gitdir))
return dirname
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):
status,output,error = \
self._u_invoke_client("config", "user.name", expect=(0,1))
@@ -102,9 +102,8 @@ class Git(vcs.VCS):
if revision==None:
vcs.VCS._vcs_duplicate_repo(self, directory, revision)
else:
- #self._u_invoke_client("archive", revision, directory) # makes tarball
- self._u_invoke_client("clone", "--no-checkout",".",directory)
- self._u_invoke_client("checkout", revision, directory=directory)
+ self._u_invoke_client("clone", "--no-checkout", ".", directory)
+ self._u_invoke_client("checkout", revision, cwd=directory)
def _vcs_commit(self, commitfile, allow_empty=False):
args = ['commit', '--all', '--file', commitfile]
if allow_empty == True: