Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3480201

Browse files
committed
Added debug code to keep lines fed into progress handler and the contents of FETCH_HEAD.
This data will be written into the git-repository itself, prefixed with thenumber of the operation.Thus, a test-run with exactly one fetch operation would look like this afterwards:ls -l .gittotal 96-----> -rw-r--r-- 1 byron staff 141B Jan 16 11:54 000_debug_git-python_FETCH_HEAD <----------> -rw-r--r-- 1 byron staff 180B Jan 16 11:54 000_debug_git-python_stderr <------rw-r--r-- 1 byron staff 487B Jan 16 11:54 FETCH_HEAD-rw-r--r-- 1 byron staff 22B Jan 16 11:54 HEAD-rw-r--r-- 1 byron staff 41B Jan 16 11:54 ORIG_HEADdrwxr-xr-x 2 byron staff 68B Jan 16 11:54 branches/-rw-r--r-- 1 byron staff 560B Jan 16 11:54 config-rw-r--r-- 1 byron staff 73B Jan 16 11:54 descriptiondrwxr-xr-x 11 byron staff 374B Jan 16 11:54 hooks/-rw-r--r-- 1 byron staff 13K Jan 16 11:54 indexdrwxr-xr-x 3 byron staff 102B Jan 16 11:54 info/drwxr-xr-x 4 byron staff 136B Jan 16 11:54 logs/drwxr-xr-x 12 byron staff 408B Jan 16 11:54 objects/-rw-r--r-- 1 byron staff 1.2K Jan 16 11:54 packed-refsdrwxr-xr-x 5 byron staff 170B Jan 16 11:54 refs/[ci skip]
1 parenta9a5414 commit3480201

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

‎git/remote.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ class Remote(LazyMixin, Iterable):
338338
NOTE: When querying configuration, the configuration accessor will be cached
339339
to speed up subsequent accesses."""
340340

341-
__slots__= ("repo","name","_config_reader")
341+
__slots__= ("repo","name","_config_reader","fetch_no")
342342
_id_attribute_="name"
343343

344344
def__init__(self,repo,name):
@@ -348,6 +348,7 @@ def __init__(self, repo, name):
348348
:param name: the name of the remote, i.e. 'origin'"""
349349
self.repo=repo
350350
self.name=name
351+
self.fetch_no=0
351352

352353
ifos.name=='nt':
353354
# some oddity: on windows, python 2.5, it for some reason does not realize
@@ -523,7 +524,9 @@ def _get_fetch_info_from_stderr(self, proc, progress):
523524

524525
progress_handler=progress.new_message_handler()
525526

527+
stderr_fetch=open(join(self.repo.git_dir,'%03i_debug_git-python_stderr'%self.fetch_no),'wb')
526528
defmy_progress_handler(line):
529+
stderr_fetch.write((line+'\n').encode(defenc))
527530
forplineinprogress_handler(line):
528531
ifline.startswith('fatal:'):
529532
raiseGitCommandError(("Error when fetching: %s"%line,),2)
@@ -539,8 +542,12 @@ def my_progress_handler(line):
539542

540543
# We are only interested in stderr here ...
541544
handle_process_output(proc,None,my_progress_handler,finalize_process)
545+
stderr_fetch.close()
542546

543547
# read head information
548+
importshutil
549+
shutil.copyfile(join(self.repo.git_dir,'FETCH_HEAD'),join(self.repo.git_dir,'%03i_debug_git-python_FETCH_HEAD'%self.fetch_no))
550+
self.fetch_no+=1
544551
fp=open(join(self.repo.git_dir,'FETCH_HEAD'),'rb')
545552
fetch_head_info= [l.decode(defenc)forlinfp.readlines()]
546553
fp.close()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp