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

hggtk: more import pruning

Changeset a05aebba91df

Parent d0eacc88f1a3

by Steve Borho

Changes to 8 files · Browse files at a05aebba91df Showing diff from parent d0eacc88f1a3 Diff from another changeset...

Change 1 of 1 Show Entire File hggtk/​backout.py Stacked
 
5
6
7
8
9
10
11
 
5
6
7
 
8
9
10
@@ -5,7 +5,6 @@
 # Copyright (C) 2007 TK Soh <teekaysoh@gmail.com>  #   -import os  import gtk  import gobject  import pango
Change 1 of 1 Show Entire File hggtk/​gdialog.py Stacked
 
10
11
12
13
14
15
16
17
18
19
20
21
22
 
10
11
12
 
13
14
 
15
 
 
16
17
18
@@ -10,13 +10,9 @@
 import threading  import cStringIO  import sys -import shlex  import shutil  import tempfile -  import gtk -import gobject -import pango    from mercurial.node import short  from mercurial import cmdutil, util, ui, hg, commands
Change 1 of 1 Show Entire File hggtk/​gtklib.py Stacked
 
10
11
12
13
 
14
15
16
 
10
11
12
 
13
14
15
16
@@ -10,7 +10,7 @@
 import pango    from thgutil.i18n import _ -from thgutil import hglib, paths +from thgutil import paths    def set_tortoise_icon(window, thgicon):   ico = paths.get_tortoise_icon(thgicon)
Change 1 of 2 Show Entire File hggtk/​hgthread.py Stacked
 
4
5
6
7
8
9
10
11
12
13
 
15
16
17
18
19
20
21
 
4
5
6
 
7
 
 
8
9
10
 
12
13
14
 
15
16
17
@@ -4,10 +4,7 @@
 # Copyright (C) 2007 TK Soh <teekaysoh@gmail.com>  #   -import sys  import gtk -import gobject -import pango  import Queue  import urllib2   @@ -15,7 +12,6 @@
   from thgutil.i18n import _  from thgutil import hglib -from thgutil import shlib  from thgutil import thread2    from hggtk import dialog
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
215
216
217
218
219
220
221
222
223
224
225
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
215
216
217
218
219
220
221
222
223
224
 #  # logfilter.py - TortoiseHg's dialog for defining log filter criteria  #  # Copyright (C) 2007 TK Soh <teekaysoh@gmail.com>  #   +import os  import gtk -import os -import sys    from mercurial import cmdutil, util, hg, ui    from thgutil.i18n import _  from thgutil import hglib    from hggtk import gtklib    class FilterDialog(gtk.Dialog):   """ Dialog for creating log filters """   def __init__(self, root='', revs=[], files=[], filterfunc=None):   """ Initialize the Dialog """   buttons = (gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE)   super(FilterDialog, self).__init__(flags=gtk.DIALOG_MODAL,   buttons=buttons)   gtklib.set_tortoise_icon(self, 'menucheckout.ico')   gtklib.set_tortoise_keys(self)     self._btn_apply = gtk.Button(_('Apply'))   self._btn_apply.connect('clicked', self._btn_apply_clicked)   self.action_area.pack_end(self._btn_apply)     self.set_title(_("Log Filter - %s") % os.path.basename(root))     self.filterfunc = filterfunc     try:   self.repo = hg.repository(ui.ui(), path=root)   except hglib.RepoError:   return None     self.set_default_size(350, 120)     self.tips = gtk.Tooltips()     # branch: combo box   hbox = gtk.HBox()   self.branchradio = gtk.RadioButton(None, _('Branch'))   self.branchlist = gtk.ListStore(str)   self.branchbox = gtk.ComboBoxEntry(self.branchlist, 0)   hbox.pack_start(self.branchradio, False, False, 4)   hbox.pack_start(self.branchbox, True, True, 4)   eventbox = gtk.EventBox()   eventbox.add(hbox)   self.tips.set_tip(eventbox, _('View revision graph of named branch'))   self.vbox.pack_start(eventbox, False, False, 4)   for name in self.repo.branchtags().keys():   self.branchlist.append([name])     # Revision range entries   hbox = gtk.HBox()   self.revradio = gtk.RadioButton(self.branchradio, _('Rev Range'))   self.rev0Entry = gtk.Entry()   self.rev0Entry.connect('activate', self._btn_apply_clicked)   self.rev1Entry = gtk.Entry()   self.rev1Entry.connect('activate', self._btn_apply_clicked)   hbox.pack_start(self.revradio, False, False, 4)   hbox.pack_start(self.rev0Entry, True, False, 4)   hbox.pack_start(self.rev1Entry, True, False, 4)   eventbox = gtk.EventBox()   eventbox.add(hbox)   self.tips.set_tip(eventbox, _('View range of revisions'))   self.vbox.pack_start(eventbox, False, False, 4)   if revs:   self.rev0Entry.set_text(str(revs[0]))   if len(revs) > 1:   self.rev1Entry.set_text(str(revs[1]))     hbox = gtk.HBox()   self.searchradio = gtk.RadioButton(self.branchradio, _('Search Filter'))   hbox.pack_start(self.searchradio, False, False, 4)   eventbox = gtk.EventBox()   eventbox.add(hbox)   self.tips.set_tip(eventbox, _('Search repository changelog with'   ' criteria'))   self.vbox.pack_start(eventbox, False, False, 4)     self.searchframe = gtk.Frame()   self.vbox.pack_start(self.searchframe, True, False, 4)   vbox = gtk.VBox()   self.searchframe.add(vbox)     hbox = gtk.HBox()   self.filesentry = gtk.Entry()   self.filesentry.connect('activate', self._btn_apply_clicked)   lbl = gtk.Label(_('File(s):'))   lbl.set_property('width-chars', 12)   lbl.set_alignment(0, 0.5)   hbox.pack_start(lbl, False, False, 4)   hbox.pack_start(self.filesentry, True, True, 4)   eventbox = gtk.EventBox()   eventbox.add(hbox)   self.tips.set_tip(eventbox, _('Display only changesets affecting these'   ' comma separated file paths'))   vbox.pack_start(eventbox, False, False, 4)   if files:   self.filesentry.set_text(', '.join(files))     hbox = gtk.HBox()   self.kwentry = gtk.Entry()   self.kwentry.connect('activate', self._btn_apply_clicked)   lbl = gtk.Label(_('Keyword(s):'))   lbl.set_property('width-chars', 12)   lbl.set_alignment(0, 0.5)   hbox.pack_start(lbl, False, False, 4)   hbox.pack_start(self.kwentry, True, True, 4)   eventbox = gtk.EventBox()   eventbox.add(hbox)   self.tips.set_tip(eventbox, _('Display only changesets matching these'   ' comma separated case insensitive keywords'))   vbox.pack_start(eventbox, False, False, 4)     hbox = gtk.HBox()   self.dateentry = gtk.Entry()   self.dateentry.connect('activate', self._btn_apply_clicked)   self.helpbutton = gtk.Button("?")   self.helpbutton.set_relief(gtk.RELIEF_NONE)   self.tips.set_tip(self.helpbutton, _('Help on date formats'))   self.helpbutton.connect('clicked', self._date_help)   lbl = gtk.Label(_('Date:'))   lbl.set_property('width-chars', 12)   lbl.set_alignment(0, 0.5)   hbox.pack_start(lbl, False, False, 4)   hbox.pack_start(self.dateentry, True, True, 4)   hbox.pack_start(self.helpbutton, False, False, 4)   eventbox = gtk.EventBox()   eventbox.add(hbox)   self.tips.set_tip(eventbox, _('Display only changesets matching this'   ' date specification'))   vbox.pack_start(eventbox, False, False, 4)     self.searchradio.connect('toggled', self.searchtoggle)   self.revradio.connect('toggled', self.revtoggle)   self.branchradio.connect('toggled', self.branchtoggle)     # toggle them all once   self.searchradio.set_active(True)   self.branchradio.set_active(True)   self.revradio.set_active(True)   self.rev0Entry.grab_focus()     # show them all   self.show_all()     def searchtoggle(self, button):   self.searchframe.set_sensitive(button.get_active())     def revtoggle(self, button):   self.rev0Entry.set_sensitive(button.get_active())   self.rev1Entry.set_sensitive(button.get_active())     def branchtoggle(self, button):   self.branchbox.set_sensitive(button.get_active())     def _toolbutton(self, stock, label, handler,   menu=None, userdata=None, tip=None):   if menu:   tbutton = gtk.MenuToolButton(stock)   tbutton.set_menu(menu)   else:   tbutton = gtk.ToolButton(stock)     tbutton.set_label(label)   if tip:   tbutton.set_tooltip(self.tips, tip)   tbutton.connect('clicked', handler, userdata)   return tbutton     def _btn_apply_clicked(self, button, data=None):   opts = {}   if self.searchradio.get_active():   pats = self.filesentry.get_text()   kw = self.kwentry.get_text()   date = self.dateentry.get_text()   if pats:   opts['pats'] = [p.strip() for p in pats.split(',')]   if kw:   opts['keyword'] = [w.strip() for w in kw.split(',')]   if date:   try:   # return of matchdate not used, just sanity checking   util.matchdate(date)   opts['date'] = date   except (ValueError, util.Abort), e:   Prompt(_('Invalid date specification'), str(e), self).run()   self.dateentry.grab_focus()   return   elif self.revradio.get_active():   rev0 = self.rev0Entry.get_text()   rev1 = self.rev1Entry.get_text()   if not rev1:   rev1 = rev0   try:   rrange = cmdutil.revrange(self.repo, [rev0, rev1])   rrange.sort()   rrange.reverse()   opts['revrange'] = rrange   except Exception, e:   Prompt(_('Invalid revision range'), str(e), self).run()   self.rev0Entry.grab_focus()   return   elif self.branchradio.get_active():   branch = self.branchbox.child.get_text()   if branch:   opts['branch'] = branch   else:   return     if self.filterfunc:   self.filterfunc(opts)     def _date_help(self, button):   from hgcmd import CmdDialog   dlg = CmdDialog(['hg', 'help', 'dates'], False)   dlg.run()   dlg.hide()
Change 1 of 1 Show Entire File hggtk/​status.py Stacked
 
12
13
14
15
16
17
18
 
12
13
14
 
15
16
17
@@ -12,7 +12,6 @@
 import gtk  import gobject  import pango -import gobject    from mercurial import cmdutil, util, commands, patch, mdiff  from mercurial import merge as merge_
 
12
13
14
15
 
16
17
18
 
12
13
14
 
15
16
17
18
@@ -12,7 +12,7 @@
 from thgutil.i18n import _    from status import GStatus, FM_STATUS, FM_CHECKED, DM_CHUNK_ID, DM_REJECTED -from hggtk import hgshelve +from hggtk import hgshelve, gdialog    class GShelve(GStatus):   """GTK+ based dialog for displaying repository status and shelving changes.
Change 1 of 1 Show Entire File hggtk/​update.py Stacked
 
6
7
8
 
9
10
11
 
6
7
8
9
10
11
12
@@ -6,6 +6,7 @@
   import os  import gtk +import gobject    from mercurial import hg, ui