mercurial/debugcommands.py
changeset 51945 a8e1ff9ac257
parent 51935 8d9767bf4adb
child 52077 a021da4ec509
--- a/mercurial/debugcommands.py	Thu Oct 03 19:49:05 2024 -0400
+++ b/mercurial/debugcommands.py	Thu Oct 03 21:08:10 2024 -0400
@@ -2238,6 +2238,13 @@
 
     locks = []
     try:
+        # Help the tests out on Windows by writing the correct PID when
+        # invoked by the test harness, before creating the lock.
+        pids = encoding.environ.get(b'DAEMON_PIDS')
+        if pids:
+            with open(pids, "ab") as fp:
+                fp.write(b'%d\n' % os.getpid())
+
         if opts.get('set_wlock'):
             try:
                 locks.append(repo.wlock(False))