# Date 1627138206 -28800
# Sat Jul 24 22:50:06 2021 +0800
# Node ID 4bc900808cb5f1cae74a5db311feaa618d14057b
# Parent 85b166783acf94584b0e6c4db1a34cc323e27203
visdiff: don't use a separate thread to start diff tool
When using a separate thread without error handling, exceptions that occur when
starting diff tool are not visible to the UI. The non-blocking behaviour is
preserved by not waiting the diff tool process to exit.
diff --git a/tortoisehg/hgqt/visdiff.py b/tortoisehg/hgqt/visdiff.py
--- a/tortoisehg/hgqt/visdiff.py
+++ b/tortoisehg/hgqt/visdiff.py
@@ -438,7 +438,7 @@
phash1=str(ctx1a), phash2=str(ctx1b),
repo=hglib.fromunicode(repoagent.displayName()),
clabel=label2, child=dir2, chash=str(ctx2)) # type: Dict[Text, Union[bytes, Text]]
- launchtool(diffcmd, args, replace, True)
+ launchtool(diffcmd, args, replace, mainapp)
# detect if changes were made to mirrored working files
for copy_fn, working_fn, mtime in fns_and_mtime:
@@ -451,14 +451,7 @@
except EnvironmentError:
pass # Ignore I/O errors or missing files
- if mainapp:
- dodiff()
- else:
- # We are not the main application, so this must be done in a
- # background thread
- thread = threading.Thread(target=dodiff, name='visualdiff')
- thread.setDaemon(True)
- thread.start()
+ dodiff()
class FileSelectionDialog(QDialog):
'Dialog for selecting visual diff candidates'