Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork938
repo, cmd: DROP UNEEDED Win path for chcwd & check for '~' homedir#529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -62,8 +62,11 @@ | ||
import os | ||
import sys | ||
import re | ||
import logging | ||
from collections import namedtuple | ||
log = logging.getLogger(__name__) | ||
DefaultDBType = GitCmdObjectDB | ||
if sys.version_info[:2] < (2, 5): # python 2.4 compatiblity | ||
DefaultDBType = GitCmdObjectDB | ||
@@ -871,46 +874,15 @@ def _clone(cls, git, url, path, odb_default_type, progress, **kwargs): | ||
if progress is not None: | ||
progress = to_progress_instance(progress) | ||
odbt = kwargs.pop('odbt', odb_default_type) | ||
proc = git.clone(url, path, with_extended_output=True, as_process=True, | ||
v=True, **add_progress(kwargs, git, progress)) | ||
if progress: | ||
handle_process_output(proc, None, progress.new_message_handler(), finalize_process) | ||
else: | ||
(stdout, stderr) = proc.communicate() # FIXME: Will block of outputs are big! | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. It's quite amazing that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Well, you are quite right - I did a small experiment of reading a Gbyte, both in PY27 and PY35, and they do not block: >>>importsubprocessassb>>>proc=sb.Popen('dd if=/dev/zero bs=1024 count=1000000',bufsize=0,stdin=sb.PIPE,stdout=sb.PIPE,stderr=sb.PIPE)>>>a,b=proc.communicate() I don't remember when I got this mistrust for One or two changes in mywindows fixes were under this wrong assumption that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. A nice experiment ! It doesn't seem to output both on stdout and stderr though, which might be causing the problem we see. Theimplementation of communicate looks asynchronous, but who knows what's hidden in the details. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Even when >>>importsubprocessassb>>>proc=sb.Popen(['python','-c',"import sys\nfor i in range(1000000):\n print('a'*1024); print('b'*1024, file=sys.stderr)"],stdin=sb.PIPE,stdout=sb.PIPE,stderr=sb.PIPE)>>>%timea,b=proc.communicate()Walltime:48.3s>>>len(a),len(b)(1026000000,1026000000) For some "unicode" reason cannot run the above experiment in PY2. | ||
log.debug("Cmd(%s)'s unused stdout: %s", getattr(proc, 'args', ''), stdout) | ||
finalize_process(proc, stderr=stderr) | ||
# our git command could have a different working dir than our actual | ||
# environment, hence we prepend its working dir if required | ||
@@ -922,7 +894,7 @@ def _clone(cls, git, url, path, odb_default_type, progress, **kwargs): | ||
# that contains the remote from which we were clones, git stops liking it | ||
# as it will escape the backslashes. Hence we undo the escaping just to be | ||
# sure | ||
repo = cls(path, odbt=odbt) | ||
if repo.remotes: | ||
with repo.remotes[0].config_writer as writer: | ||
writer.set_value('url', repo.remotes[0].url.replace("\\\\", "\\").replace("\\", "/")) | ||