Patchwork [2,of,3,hg-2.5] run-tests.py: don't let hg run interactively in debug mode

login
register
mail settings
Submitter Mads Kiilerich
Date Jan. 19, 2013, 12:18 a.m.
Message ID <fa3d243c80436334fc3a.1358554712@mk-desktop>
Download mbox | patch
Permalink /patch/683/
State Accepted
Commit 20462259b92afdd05709b65a0e82359142e625de
Headers show

Comments

Mads Kiilerich - Jan. 19, 2013, 12:18 a.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1358468631 -3600
# Node ID fa3d243c80436334fc3a2e230b37ceaf42c53007
# Parent  dfd172372e2a9b213f02ea1184dfcb2d1ca35fb1
run-tests.py: don't let hg run interactively in debug mode

In normal test mode stdin is closed and hg is thus not interactive. In --debug
mode stdin is inherited from the running console and to the tests, and hg could
thus wait in prompts when running on Windows.

See http://selenic.com/pipermail/mercurial-devel/2013-January/047548.html .

Instead set ui.interactive=False to make Mercurial non-interactive. Other
commands might still work differently in the --debug environment.

This should solve the problem with hg waiting for input but still make it
possible to add --debugger to hg in a test and run run-tests.py with --debug.

Patch

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -874,6 +874,7 @@ 
     hgrc = open(HGRCPATH, 'w+')
     hgrc.write('[ui]\n')
     hgrc.write('slash = True\n')
+    hgrc.write('interactive = False\n')
     hgrc.write('[defaults]\n')
     hgrc.write('backout = -d "0 0"\n')
     hgrc.write('commit = -d "0 0"\n')
diff --git a/tests/test-commandserver.py.out b/tests/test-commandserver.py.out
--- a/tests/test-commandserver.py.out
+++ b/tests/test-commandserver.py.out
@@ -75,6 +75,7 @@ 
 defaults.commit=-d "0 0"
 defaults.tag=-d "0 0"
 ui.slash=True
+ui.interactive=False
 ui.foo=bar
  runcommand init foo
  runcommand -R foo showconfig ui defaults
@@ -82,6 +83,7 @@ 
 defaults.commit=-d "0 0"
 defaults.tag=-d "0 0"
 ui.slash=True
+ui.interactive=False
 
 testing hookoutput: