From 4294d741cc13e1f5533efaa693e4479c62b28873 Mon Sep 17 00:00:00 2001 From: Yang Zhao Date: Fri, 13 Dec 2019 15:52:43 -0800 Subject: 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 Reviewed-by: Ben Keene Signed-off-by: Junio C Hamano 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) -- cgit v0.10.2-6-g49f6