summaryrefslogtreecommitdiff
path: root/git-p4.py
diff options
context:
space:
mode:
authorYang Zhao <yang.zhao@skyboxlabs.com>2019-12-13 23:52:43 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-01-15 20:53:40 (GMT)
commit4294d741cc13e1f5533efaa693e4479c62b28873 (patch)
tree2cf19c20564e63385ceb9200965bb3e6f77c2a85 /git-p4.py
parent50da1e73933386ef95499d2f7753184ba82ce2b3 (diff)
downloadgit-4294d741cc13e1f5533efaa693e4479c62b28873.zip
git-4294d741cc13e1f5533efaa693e4479c62b28873.tar.gz
git-4294d741cc13e1f5533efaa693e4479c62b28873.tar.bz2
git-p4: fix freezing while waiting for fast-import progress
As part of its importing process, git-p4 sends a `checkpoint` followed immediately by `progress` to fast-import to force synchronization. Due to buffering, it is possible for the `progress` command to not be flushed before git-p4 begins to wait for the corresponding response. This causes the script to freeze completely, and is consistently observable at least on python-3.6.9. Make sure this command sequence is completely flushed before waiting. Signed-off-by: Yang Zhao <yang.zhao@skyboxlabs.com> Reviewed-by: Ben Keene <seraphire@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-p4.py')
-rwxr-xr-xgit-p4.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/git-p4.py b/git-p4.py
index c7170c9..68f9f4f 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -2641,6 +2641,7 @@ class P4Sync(Command, P4UserMap):
def checkpoint(self):
self.gitStream.write("checkpoint\n\n")
self.gitStream.write("progress checkpoint\n\n")
+ self.gitStream.flush()
out = self.gitOutput.readline()
if self.verbose:
print("checkpoint finished: " + out)