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

merge with Adrian

Changeset 467ad3fa71d1

Parents 1c9faadf11e3

Parents ab987be207ae

by Steve Borho

Changes to 5 files · Browse files at 467ad3fa71d1 Showing diff from parent 1c9faadf11e3 ab987be207ae Diff from another changeset...

Change 1 of 1 Show Entire File contrib/​tracelog.py Stacked
 
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
@@ -1,142 +0,0 @@
-# -# A PyGtk-based Python Trace Collector window -# -# Copyright (C) 2007 TK Soh <teekaysoh@gmail.com> -# - -import pygtk -pygtk.require("2.0") -import gtk -import gobject -import pango -import threading -import Queue -import win32trace -import time - -try: - from hggtk.hglib import toutf -except ImportError: - import locale - _encoding = locale.getpreferredencoding() - def toutf(s): - return s.decode(_encoding, 'replace').encode('utf-8') - -class TraceLog(): - def __init__(self): - self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) - self.window.set_title("Python Trace Collector") - - # construct window - self.window.set_default_size(700, 400) - self.main_area = gtk.VBox() - self.window.add(self.main_area) - - # mimic standard dialog widgets - self.action_area = gtk.HBox() - self.main_area.pack_end(self.action_area, False, False, 5) - sep = gtk.HSeparator() - self.main_area.pack_end(sep, False, False, 0) - self.vbox = gtk.VBox() - self.main_area.pack_end(self.vbox) - - # add python trace ouput window - scrolledwindow = gtk.ScrolledWindow() - scrolledwindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) - self.textview = gtk.TextView(buffer=None) - self.textview.set_editable(False) - self.textview.modify_font(pango.FontDescription("Monospace")) - scrolledwindow.add(self.textview) - self.textview.set_editable(False) - self.textbuffer = self.textview.get_buffer() - self.vbox.pack_start(scrolledwindow, True, True) - self.vbox.show_all() - - # add buttons - self._button_quit = gtk.Button("Quit") - self._button_quit.connect('clicked', self._on_ok_clicked) - self.action_area.pack_end(self._button_quit, False, False, 5) - - self._button_clear = gtk.Button("Clear") - self._button_clear.connect('clicked', self._on_clear_clicked) - self.action_area.pack_end(self._button_clear, False, False, 5) - - # add assorted window event handlers - self.window.connect('map_event', self._on_window_map_event) - self.window.connect('delete_event', self._on_window_close_clicked) - - def _on_ok_clicked(self, button): - self._stop_read_thread() - gtk.main_quit() - - def _on_clear_clicked(self, button): - self.write("", False) - - def _on_window_close_clicked(self, event, param): - self._stop_read_thread() - gtk.main_quit() - - def _on_window_map_event(self, event, param): - self._begin_trace() - - def _begin_trace(self): - self.queue = Queue.Queue() - win32trace.InitRead() - self.write("Collecting Python Trace Output...\n") - gobject.timeout_add(10, self._process_queue) - self._start_read_thread() - - def _start_read_thread(self): - self._read_trace = True - self.thread1 = threading.Thread(target=self._do_read_trace) - self.thread1.start() - - def _stop_read_thread(self): - self._read_trace = False - - # wait for worker thread to to fix Unhandled exception in thread - self.thread1.join() - - def _process_queue(self): - """ - Handle all the messages currently in the queue (if any). - """ - while self.queue.qsize(): - try: - msg = self.queue.get(0) - ts = '[%s] ' % time.strftime('%c') - for line in msg.splitlines(True): - self.write(ts + line) - except Queue.Empty: - pass - - return True - - def _do_read_trace(self): - """ - print buffer collected in win32trace - """ - while self._read_trace: - msg = win32trace.read() - if msg: - self.queue.put(msg) - - def write(self, msg, append=True): - msg = toutf(msg) - if append: - enditer = self.textbuffer.get_end_iter() - self.textbuffer.insert(enditer, msg) - else: - self.textbuffer.set_text(msg) - - def main(self): - self.window.show_all() - gtk.main() - -def run(): - dlg = TraceLog() - dlg.main() - -if __name__ == "__main__": - run() -
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
44
45
 
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
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
44
 
45
46
47
48
49
 
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
 
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
 ; Script generated by the Inno Setup Script Wizard.  ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!    [Setup]  AppCopyright=Copyright 2005-2009 Matt Mackall and others  AppName=TortoiseHg -AppVerName=TortoiseHg-0.7 +AppVerName=TortoiseHg-0.8  InfoAfterFile=contrib/win32/postinstall.txt  LicenseFile=COPYING.txt  ShowLanguageDialog=yes -AppPublisher=TK Soh and others +AppPublisher=Steve Borho and others  AppPublisherURL=http://bitbucket.org/tortoisehg/stable/  AppSupportURL=http://bitbucket.org/tortoisehg/stable/  AppUpdatesURL=http://bitbucket.org/tortoisehg/stable/  AppID=TortoiseHg  AppContact=teekaysoh@gmail.com -OutputBaseFilename=TortoiseHg-0.7 +OutputBaseFilename=TortoiseHg-0.8  DefaultDirName={pf}\TortoiseHg  SourceDir=..\..  VersionInfoDescription=Mercurial distributed SCM  VersionInfoCopyright=Copyright 2005-2009 Matt Mackall and others  VersionInfoCompany=Matt Mackall and others  InternalCompressLevel=max  SolidCompression=true  SetupIconFile=..\icons\hgicon.ico  UninstallDisplayIcon={app}\hgicon.ico  WizardImageFile=..\icons\install-wizard.bmp  WizardImageStretch=no  WizardImageBackColor=$ffffff  WizardSmallImageFile=..\icons\install-wizard-small.bmp  AllowNoIcons=true  DefaultGroupName=TortoiseHg  PrivilegesRequired=poweruser  AlwaysRestart=yes  SetupLogging=yes    [Files]  Source: contrib\mercurial.el; DestDir: {app}/contrib -Source: contrib\vim\*.*; DestDir: {app}/contrib/Vim +Source: contrib\vim\*.*; DestDir: {app}/contrib/vim  Source: contrib\zsh_completion; DestDir: {app}/contrib  Source: contrib\hgk; DestDir: {app}/contrib  Source: contrib\win32\ReadMe.html; DestDir: {app}; Flags: isreadme  Source: {app}\Mercurial.ini; DestDir: {app}\backup; Flags: external skipifsourcedoesntexist uninsneveruninstall  Source: contrib\win32\mercurial.ini; DestDir: {app}; DestName: Mercurial.ini; AfterInstall: FileExpandString('{app}\Mercurial.ini') -Source: ..\stable.snap; DestDir: {app}; DestName: ReleaseNotes.txt +Source: ReleaseNotes.txt; DestDir: {app}; DestName: ReleaseNotes.txt  Source: ..\contrib\*.exe; DestDir: {app}; Flags: ignoreversion restartreplace uninsrestartdelete  Source: ..\contrib\TortoiseOverlays\*.*; DestDir: {app}/TortoiseOverlays;  Source: dist\*.exe; DestDir: {app}; Flags: ignoreversion restartreplace uninsrestartdelete  Source: dist\*.dll; DestDir: {app}; Flags: ignoreversion restartreplace uninsrestartdelete -Source: dist\*.pyd; DestDir: {app}; Flags: ignoreversion restartreplace uninsrestartdelete  Source: dist\library.zip; DestDir: {app}  Source: doc\*.html; DestDir: {app}\docs  Source: icons\*; DestDir: {app}\icons; Flags: ignoreversion recursesubdirs createallsubdirs  Source: dist\share\*; DestDir: {app}\share; Flags: ignoreversion recursesubdirs createallsubdirs  Source: dist\lib\*; DestDir: {app}\lib; Flags: ignoreversion recursesubdirs createallsubdirs  Source: dist\etc\*; DestDir: {app}\etc; Flags: ignoreversion recursesubdirs createallsubdirs  Source: templates\*.*; DestDir: {app}\templates; Flags: recursesubdirs createallsubdirs  Source: locale\*.*; DestDir: {app}\locale; Flags: recursesubdirs createallsubdirs  Source: i18n\*.*; DestDir: {app}\i18n; Flags:  Source: CONTRIBUTORS; DestDir: {app}; DestName: Contributors.txt  Source: COPYING.txt; DestDir: {app}; DestName: Copying.txt  Source: ..\icons\hgicon.ico; DestDir: {app}  Source: ..\files\gtkrc; DestDir: {app}\etc\gtk-2.0; AfterInstall: EditOptions()    [INI]  Filename: {app}\Mercurial.url; Section: InternetShortcut; Key: URL; String: http://www.selenic.com/mercurial/  Filename: {app}\TortoiseHg.url; Section: InternetShortcut; Key: URL; String: http://bitbucket.org/tortoisehg/stable/    [Icons]  Name: {group}\TortoiseHg Web Site; Filename: {app}\TortoiseHg.url  Name: {group}\Mercurial Web Site; Filename: {app}\Mercurial.url  Name: {group}\Mercurial Command Reference; Filename: {app}\docs\hg.1.html -Name: {group}\Python Trace Collector; Filename: {app}\tracelog.exe  Name: {group}\Uninstall TortoiseHg; Filename: {uninstallexe}    [Run]  Filename: {app}\add_path.exe; Parameters: {app}; StatusMsg: Adding the installation path to the search path...  Filename: msiexec.exe; Parameters: "/i ""{app}\TortoiseOverlays\TortoiseOverlays-1.0.4.11886-win32.msi"" /qn /norestart ALLUSERS=1"; StatusMsg: Installing TortoiseOverlays.dll ...  Filename: regsvr32.exe; Parameters: "/s ""{app}\tortoisehg.dll"""; StatusMsg: Installing shell extension...    [UninstallRun]  Filename: {app}\add_path.exe; Parameters: /del {app}  Filename: regsvr32.exe; Parameters: "/s /u ""{app}\tortoisehg.dll"""    [UninstallDelete]  Type: files; Name: {app}\Mercurial.url  Type: files; Name: {app}\TortoiseHg.url    [Registry]  Root: HKLM; Subkey: Software\TortoiseHg; Flags: uninsdeletekey; ValueData: {app}  Root: HKLM; Subkey: Software\Mercurial; Flags: uninsdeletekey; ValueData: {app}\Mercurial.ini    [Code]  procedure FileExpandString(fn: String);  var   InFile: String;   i: Integer;   InFileLines: TArrayOfString;  begin   InFile := ExpandConstant(fn);   LoadStringsFromFile(InFile, InFileLines);   for i:= 0 to GetArrayLength(InFileLines)-1 do   InFileLines[i] := ExpandConstant(InFileLines[i]);   SaveStringsToFile(InFile, InFileLines, False);  end;    var ThemePage: TInputOptionWizardPage;  var IsUpgrade: Boolean;    procedure InitializeWizard;  begin   ThemePage := CreateInputOptionPage(wpSelectComponents,   'Theme Selection', '',   'Please select a theme, then click Next.',   True, False);   ThemePage.Add('Neutrino (recommended, especially on Vista)');   ThemePage.Add('Brushed');   ThemePage.Add('Blue-Steel');   ThemePage.Add('MS-Windows (original)');     case GetPreviousData('Theme', '') of   'Neutrino': ThemePage.SelectedValueIndex := 0;   'Brushed': ThemePage.SelectedValueIndex := 1;   'Blue-Steel': ThemePage.SelectedValueIndex := 2;   'MS-Windows': ThemePage.SelectedValueIndex := 3;   else   ThemePage.SelectedValueIndex := 0;   end;  end;    procedure RegisterPreviousData(PreviousDataKey: Integer);  var   Theme: String;  begin   { Store the settings so we can restore them next time }   case ThemePage.SelectedValueIndex of   0: Theme := 'Neutrino';   1: Theme := 'Brushed';   2: Theme := 'Blue-Steel';   3: Theme := 'MS-Windows';   end;   SetPreviousData(PreviousDataKey, 'Theme', Theme);  end;    procedure SetCommentMarker(var lines: TArrayOfString; option: String; selected: boolean);  var   i : integer;  begin   if selected then exit;   for i := 0 to pred(GetArrayLength(lines)) do   if pos(option, lines[i]) > 0 then   begin   lines[i][1] := '#';   end;  end;    procedure EditOptions();  var   lines : TArrayOfString;   filename : String;  begin   filename := ExpandConstant(CurrentFilename);   LoadStringsFromFile(filename, lines);     SetCommentMarker(lines, 'gtk-theme-name = "Neutrino"', ThemePage.SelectedValueIndex = 0);   SetCommentMarker(lines, 'gtk-theme-name = "Brushed"', ThemePage.SelectedValueIndex = 1);   SetCommentMarker(lines, 'gtk-theme-name = "Blue-Steel"', ThemePage.SelectedValueIndex = 2);   SetCommentMarker(lines, 'gtk-theme-name = "MS-Windows"', ThemePage.SelectedValueIndex = 3);     SaveStringsToFile(filename, lines, False);  end;    function InitializeSetup(): Boolean;  var   ThgSwReg: String;   CRLF: String;   msg: String;  begin   CRLF := chr(10) + chr(13);   Result := True;     {abort installation if TortoiseHg 0.4 or earlier is installed}   if RegQueryStringValue(HKLM, 'Software\TortoiseHg', '', ThgSwReg) then   begin   IsUpgrade := True;   {gpyfm was unbundled after 0.4, so it's a good guess}   if (FileExists(ThgSwReg + '\gpyfm.exe')) then   begin   msg := 'TortoiseHg Setup Error:' + CRLF + CRLF +   'The version of TortoiseHg installed is too old to upgrade in place.' + CRLF +   'You must uninstall it before installing this version.' + CRLF + CRLF +   'Please uninstall the existing version, then run the installer again ' +   'to continue.';   MsgBox(msg, mbError, MB_OK);   Result := False; {quit and abort installation}   end else begin   msg := 'Your current site-wide Mercurial.ini will be copied into' + CRLF +   ThgSwReg + '\backup' + CRLF +   'After install you may merge changes back into the new Mercurial.ini'   MsgBox(msg, mbInformation, MB_OK);   end;   end;  end;    function ShouldSkipPage(PageID: Integer): Boolean;  begin   { Skip wpSelectDir page if upgrading; show all others }   case PageID of   wpSelectDir:   Result := IsUpgrade;   else   Result := False;   end;  end;
 
1
2
3
4
 
5
6
7
 
1
2
3
 
4
5
6
7
@@ -1,7 +1,7 @@
 [py2exe]  excludes=pywin, pywin.dialogs, pywin.dialogs.list, PyQt, PyQt4.QtCode, PyQt4.QtGui  includes=cairo, pango, pangocairo, atk, gobject, dbhash -packages=email, hgext, hgext.convert, encodings, hggtk, hggtk.vis, hggtk.iniparse, tortoise +packages=email, hgext, hgext.convert, encodings, hggtk, thgutil    # Disabled for 0.7 release  #dll_excludes=iconv.dll, intl.dll, libatk-1.0-0.dll, libgdk_pixbuf-2.0-0.dll, libgdk-win32-2.0-0.dll, libglib-2.0-0.dll, libgmodule-2.0-0.dll, libgobject-2.0-0.dll, libgthread-2.0-0.dll, libgtk-win32-2.0-0.dll, libpango-1.0-0.dll, libpangowin32-1.0-0.dll, libcairo-2.dll, libglade-2.0-0.dll, libpangocairo-1.0-0.dll, libpangoft2-1.0-0.dll
 
92
93
94
95
96
97
98
99
100
101
102
103
104
 
134
135
136
137
138
139
140
141
142
143
144
 
 
 
 
 
 
 
 
 
 
 
145
146
147
 
185
186
187
188
189
 
190
191
192
 
92
93
94
 
 
 
 
 
95
 
96
97
98
 
128
129
130
 
 
 
 
 
 
 
 
131
132
133
134
135
136
137
138
139
140
141
142
143
144
 
182
183
184
 
 
185
186
187
188
@@ -92,13 +92,7 @@
  except ImportError:   pass   - extra['windows'] = [ - {'script':'contrib/tracelog.py', - 'icon_resources':[(1, 'icons/tortoise/python.ico')]} - ] - extra['com_server'] = ['tortoisehg']   extra['console'] = ['hg', 'hgtk'] -  except ImportError:   pass   @@ -134,14 +128,17 @@
  continue   pofile = join(podir, po)   modir = join('locale', po[:-3], 'LC_MESSAGES') - mofile = join(modir, 'hg.mo') - cmd = ['msgfmt', '-v', '-o', mofile, pofile] - if sys.platform != 'sunos5': - # msgfmt on Solaris does not know about -c - cmd.append('-c') - self.mkpath(modir) - self.make_file([pofile], mofile, spawn, (cmd,)) - self.distribution.data_files.append((join('mercurial', modir), + for mf in ('hg.mo', 'tortoisehg.mo'): + mofile = join(modir, mf) + if not os.path.exist(mofile): + continue + cmd = ['msgfmt', '-v', '-o', mofile, pofile] + if sys.platform != 'sunos5': + # msgfmt on Solaris does not know about -c + cmd.append('-c') + self.mkpath(modir) + self.make_file([pofile], mofile, spawn, (cmd,)) + self.distribution.data_files.append((join('mercurial', modir),   [mofile]))    build.sub_commands.append(('build_mo', None)) @@ -185,8 +182,7 @@
  ]    packages = ['mercurial', 'mercurial.hgweb', 'hgext', 'hgext.convert', - 'hgext.highlight', 'hgext.zeroconf', 'hggtk', 'hggtk.vis', - 'hggtk.iniparse', 'tortoise'] + 'hgext.highlight', 'hgext.zeroconf', 'hggtk', 'thgutil']    try:   import msvcrt
Change 1 of 1 Show Entire File thgutil/​i18n.py Stacked
 
10
11
12
13
14
 
 
 
10
11
12
 
 
13
14
@@ -10,5 +10,5 @@
 from gettext import gettext as _  import paths   -gettext.bindtextdomain("thg", paths.get_locale_path()) -gettext.textdomain("thg") +gettext.bindtextdomain("tortoisehg", paths.get_locale_path()) +gettext.textdomain("tortoisehg")