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

debugging: use new file for debugging in cachethg and contextmenu

Changeset 79c413ef4df1

Parent b3cb2803ba8f

by Simon Heimberg

Changes to 2 files · Browse files at 79c413ef4df1 Showing diff from parent b3cb2803ba8f Diff from another changeset...

 
2
3
4
 
5
6
7
 
37
38
39
 
40
41
42
43
44
45
46
47
48
49
 
 
 
 
 
50
51
52
 
53
54
55
 
2
3
4
5
6
7
8
 
38
39
40
41
42
43
 
 
 
 
 
 
 
 
44
45
46
47
48
49
 
 
50
51
52
53
@@ -2,6 +2,7 @@
 from mercurial import hg, cmdutil, util, ui, node, merge  import thgutil  import sys +import debugthg  try:   from mercurial.error import RepoError  except ImportError: @@ -37,19 +38,16 @@
 except ImportError:   from time import time as GetTickCount   CACHE_TIMEOUT = 5.0 + debugging = debugthg.debug('O')    if debugging: - import win32traceutil - def debugf(str, args=None): - if args: print str % args - else: print str - print 'Enabled', enabled - print 'LocalDisksOnly', localonly - print 'IncludePaths', includepaths - print 'ExcludePaths', excludepaths + debugf = debugthg.debugf + debugf('Enabled %s', enabled) + debugf('LocalDisksOnly %s', localonly) + debugf('IncludePaths %s', includepaths) + debugf('ExcludePaths %s', excludepaths)  else: - def debugf(str, args=None): - pass + debugf = debugthg.debugf_No    STATUS_STATES = 'MAR!?IC'  MODIFIED, ADDED, REMOVED, DELETED, UNKNOWN, IGNORED, UNCHANGED = STATUS_STATES
 
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
 
 
45
46
47
48
49
 
50
51
52
 
53
54
55
 
26
27
28
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
30
31
 
 
 
 
32
33
 
 
34
35
36
37
@@ -26,30 +26,12 @@
 except ImportError:   from mercurial.repo import RepoError   -debugging = False - -try: - import _winreg - try: - hkey = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, - r"Software\TortoiseHg", 0, - _winreg.KEY_ALL_ACCESS) - val = _winreg.QueryValueEx(hkey, 'ContextMenuDebug')[0] - if val in ('1', 'True'): - debugging = True - except EnvironmentError: - pass -except ImportError: - pass - +import debugthg: +debugging = debugthg.debug('M')  if debugging: - import win32traceutil - def debugf(str, args=None): - if args: print str % args - else: print str + debugf = debugthg.debugf  else: - def debugf(str, args=None): - pass + debugf = debugthg.debugf_No    appfiltered = False  try: