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

Commit697702e

Browse files
committed
index: improved the way stdout is handled as the previous handling rarely caused lockups while waiting for stdout
NOTE: This does not have the desired effect, the issue appears to be somewhere within git, possibly, as git simply does not terminate waiting for something, even if stdout is closed.
1 parentb1a2271 commit697702e

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

‎lib/git/index.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,7 @@ def add(self, items, force=True, fprogress=lambda *args: None):
926926
self._write_path_to_stdin(proc,filepath,filepath,make_exc,fprogress,read_from_stdout=False)
927927
added_files.append(filepath)
928928
# END for each filepath
929-
self._flush_stdin_and_wait(proc)# ignore stdout
929+
self._flush_stdin_and_wait(proc,ignore_stdout=True)# ignore stdout
930930

931931
# force rereading our entries once it is all done
932932
del(self.entries)
@@ -978,7 +978,7 @@ def add(self, items, force=True, fprogress=lambda *args: None):
978978
ifnotprogress_sent:
979979
fprogress(entry.path,True,entry)
980980
# END for each enty
981-
self._flush_stdin_and_wait(proc)
981+
self._flush_stdin_and_wait(proc,ignore_stdout=True)
982982
entries_added.extend(entries)
983983
# END if there are base entries
984984

@@ -1059,10 +1059,13 @@ def commit(self, message, parent_commits=None, head=True):
10591059
returnCommit.create_from_tree(self.repo,tree_sha,message,parent_commits,head)
10601060

10611061
@classmethod
1062-
def_flush_stdin_and_wait(cls,proc):
1062+
def_flush_stdin_and_wait(cls,proc,ignore_stdout=False):
10631063
proc.stdin.flush()
10641064
proc.stdin.close()
1065-
stdout=proc.stdout.read()
1065+
stdout=''
1066+
ifnotignore_stdout:
1067+
stdout=proc.stdout.read()
1068+
proc.stdout.close()
10661069
proc.wait()
10671070
returnstdout
10681071

@@ -1192,7 +1195,7 @@ def handle_stderr(proc, iter_checked_out_files):
11921195
checked_out_files.append(path)
11931196
# END path is a file
11941197
# END for each path
1195-
self._flush_stdin_and_wait(proc)
1198+
self._flush_stdin_and_wait(proc,ignore_stdout=True)
11961199

11971200
handle_stderr(proc,checked_out_files)
11981201
returnchecked_out_files

‎lib/git/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def _has_lock(self):
139139
raiseAssertionError("The lock file at %s could not be read"%lock_file)
140140

141141
ifpid!=os.getpid():
142-
raiseAssertionError("We claim to own the lock at %s, but it was not owned by our process: %i"% (lock_file,os.getpid()))
142+
raiseAssertionError("We claim to own the lock at %s, but it was not owned by our process %i, but by %i"% (lock_file,os.getpid(),pid))
143143

144144
returnTrue
145145

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp