Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

debugthg: fix import error

Changeset 4cfaab49b8ac

Parent 431475758b60

by Steve Borho

Changes to one file · Browse files at 4cfaab49b8ac Showing diff from parent 431475758b60 Diff from another changeset...

1
2
3
4
5
6
7
8
 
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
1
2
3
4
5
6
7
 
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
 debugging = ''  try:   import _winreg   try:   hkey = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER,   r"Software\TortoiseHg", 0,   _winreg.KEY_ALL_ACCESS) - val = QueryValueEx(hkey, 'OverlayDebug')[0] + val = _winreg.QueryValueEx(hkey, 'OverlayDebug')[0]   if val in ('1', 'True'):   debugging += 'O'   val = _winreg.QueryValueEx(hkey, 'ContextMenuDebug')[0]   if val in ('1', 'True'):   debugging += 'M'   if debugging:   import win32traceutil   except EnvironmentError:   pass  except ImportError:   import os   debugging = os.environ.get("DEBUG_THG", "")   if debugging.lower() in (1, "true"):   debugging = True    def debugf_No(str, args=None, level=''):   pass    if debugging:   def debug(level=''):   return debugging == True or level in debugging   def debugf(str, args=None, level=''):   if not debug(level):   return   if args:   print str % args   elif debug('e') and isinstance(str, BaseException):   import traceback   traceback.print_exc()   else:   print str  else:   def debug(level=''):   return False   debugf = debugf_No