comparison tests/test-ui-verbosity @ 5523:5db730475d6d

tests/*: avoid losing the original settings from $HGRCPATH
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Fri, 09 Nov 2007 20:21:35 -0200
parents 25d270e0b27f
children 6b5522cb2ad2
comparison
equal deleted inserted replaced
5522:f5345a2d2391 5523:5db730475d6d
2 2
3 import os 3 import os
4 from mercurial import ui 4 from mercurial import ui
5 5
6 hgrc = os.environ['HGRCPATH'] 6 hgrc = os.environ['HGRCPATH']
7 f = open(hgrc)
8 basehgrc = f.read()
9 f.close()
7 10
8 print ' hgrc settings command line options final result ' 11 print ' hgrc settings command line options final result '
9 print ' quiet verbo debug quiet verbo debug quiet verbo debug' 12 print ' quiet verbo debug quiet verbo debug quiet verbo debug'
10 13
11 for i in xrange(64): 14 for i in xrange(64):
15 cmd_quiet = bool(i & 1<<3) 18 cmd_quiet = bool(i & 1<<3)
16 cmd_verbose = bool(i & 1<<4) 19 cmd_verbose = bool(i & 1<<4)
17 cmd_debug = bool(i & 1<<5) 20 cmd_debug = bool(i & 1<<5)
18 21
19 f = open(hgrc, 'w') 22 f = open(hgrc, 'w')
20 f.write('[ui]\n') 23 f.write(basehgrc)
24 f.write('\n[ui]\n')
21 if hgrc_quiet: 25 if hgrc_quiet:
22 f.write('quiet = True\n') 26 f.write('quiet = True\n')
23 if hgrc_verbose: 27 if hgrc_verbose:
24 f.write('verbose = True\n') 28 f.write('verbose = True\n')
25 if hgrc_debug: 29 if hgrc_debug: