From 4b586fbb94d5acc6e06980a8a96f66771280beda Mon Sep 17 00:00:00 2001 From: Kostis Anagnostopoulos Date: Tue, 4 Oct 2016 14:29:28 +0200 Subject: daemon, #525: FIX remote urls in config-files + Parse most remote & config-urls \-->/. + Used relative daemon-paths. + Use git-daemon PORT above 10k; on Windows all below need Admin rights. +FIXED git-daemon @with_rw_and_rw_remote_repo(): + test_base.test_with_rw_remote_and_rw_repo() PASS. + test_remote.test_base() now freezes! (so still hidden win_err) + repo_test: minor finally delete test-repos created inside this repo. + util: delete unused `absolute_project_path()`. --- git/remote.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'git/remote.py') diff --git a/git/remote.py b/git/remote.py index a7d3fe7e..8a46b2c5 100644 --- a/git/remote.py +++ b/git/remote.py @@ -29,7 +29,7 @@ from git.util import ( join_path, finalize_process ) -from git.cmd import handle_process_output +from git.cmd import handle_process_output, Git from gitdb.util import join from git.compat import (defenc, force_text, is_win) import logging @@ -570,7 +570,7 @@ class Remote(LazyMixin, Iterable): :raise GitCommandError: in case an origin with that name already exists""" scmd = 'add' kwargs['insert_kwargs_after'] = scmd - repo.git.remote(scmd, name, url, **kwargs) + repo.git.remote(scmd, name, Git.polish_url(url), **kwargs) return cls(repo, name) # add is an alias -- cgit v1.2.1 From 85f38a1bbc8fc4b19ebf2a52a3640b59a5dcf9fe Mon Sep 17 00:00:00 2001 From: Kostis Anagnostopoulos Date: Wed, 12 Oct 2016 23:09:54 +0200 Subject: remote, #525: pump fetch-infos instead of GIL-read stderr + `handle_process_output()` accepts null-finalizer, to pump completely stderr before raising any errors. + test: Enable `TestGit.test_environment()` on Windows (to checks stderr consumption). --- git/remote.py | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) (limited to 'git/remote.py') diff --git a/git/remote.py b/git/remote.py index 8a46b2c5..2b924aaf 100644 --- a/git/remote.py +++ b/git/remote.py @@ -630,25 +630,19 @@ class Remote(LazyMixin, Iterable): cmds = set(PushInfo._flag_map.keys()) & set(FetchInfo._flag_map.keys()) progress_handler = progress.new_message_handler() + handle_process_output(proc, None, progress_handler, finalizer=None, decode_streams=False) - stderr_text = None + stderr_text = progress.error_lines and '\n'.join(progress.error_lines) or '' + proc.wait(stderr=stderr_text) + if stderr_text: + log.warning("Error lines received while fetching: %s", stderr_text) - for line in proc.stderr: + for line in progress.other_lines: line = force_text(line) - for pline in progress_handler(line): - # END handle special messages - for cmd in cmds: - if len(line) > 1 and line[0] == ' ' and line[1] == cmd: - fetch_info_lines.append(line) - continue - # end find command code - # end for each comand code we know - # end for each line progress didn't handle - # end - if progress.error_lines(): - stderr_text = '\n'.join(progress.error_lines()) - - finalize_process(proc, stderr=stderr_text) + for cmd in cmds: + if len(line) > 1 and line[0] == ' ' and line[1] == cmd: + fetch_info_lines.append(line) + continue # read head information with open(join(self.repo.git_dir, 'FETCH_HEAD'), 'rb') as fp: -- cgit v1.2.1 From 5e6827e98c2732863857c0887d5de4138a8ae48b Mon Sep 17 00:00:00 2001 From: Kostis Anagnostopoulos Date: Thu, 13 Oct 2016 00:42:04 +0200 Subject: remote, #525: FIX BUG push-cmd misses error messages + Bug discovered after enabling TC in prev commit and rework of fetch. + remote_tc: unitestize assertions. + util: DEL unused `_mktemp()`. --- git/remote.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'git/remote.py') diff --git a/git/remote.py b/git/remote.py index 2b924aaf..71585a41 100644 --- a/git/remote.py +++ b/git/remote.py @@ -27,7 +27,6 @@ from git.util import ( ) from git.util import ( join_path, - finalize_process ) from git.cmd import handle_process_output, Git from gitdb.util import join @@ -681,16 +680,19 @@ class Remote(LazyMixin, Iterable): try: output.append(PushInfo._from_line(self, line)) except ValueError: - # if an error happens, additional info is given which we cannot parse + # If an error happens, additional info is given which we parse below. pass - # END exception handling - # END for each line + handle_process_output(proc, stdout_handler, progress_handler, finalizer=None, decode_streams=False) + stderr_text = progress.error_lines and '\n'.join(progress.error_lines) or '' try: - handle_process_output(proc, stdout_handler, progress_handler, finalize_process, decode_streams=False) + proc.wait(stderr=stderr_text) except Exception: - if len(output) == 0: + if not output: raise + elif stderr_text: + log.warning("Error lines received while fetching: %s", stderr_text) + return output def _assert_refspec(self): -- cgit v1.2.1