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

hggtk: remove unused imports

Changeset 3bb172e216bd

Parent 7712a5446a93

by Steve Borho

Changes to 9 files · Browse files at 3bb172e216bd Showing diff from parent 7712a5446a93 Diff from another changeset...

Change 1 of 1 Show Entire File hggtk/​clone.py Stacked
 
7
8
9
10
 
11
12
13
 
7
8
9
 
10
11
12
13
@@ -7,7 +7,7 @@
 import gtk  import os  import pango -from mercurial import hg, ui, cmdutil, util +from mercurial import ui, util  from thgutil.i18n import _  from thgutil import shlib  import gdialog
Change 1 of 1 Show Entire File hggtk/​datamine.py Stacked
 
10
11
12
13
 
14
15
16
 
10
11
12
 
13
14
15
16
@@ -10,7 +10,7 @@
 import Queue  import threading   -from mercurial import hg, ui, util, revlog +from mercurial import util    from thgutil.i18n import _  from thgutil.hglib import *
Change 1 of 1 Show Entire File hggtk/​recovery.py Stacked
 
11
12
13
14
 
15
16
17
 
11
12
13
 
14
15
16
17
@@ -11,7 +11,7 @@
 import Queue  import os   -from mercurial import hg, ui, util +from mercurial import hg, ui    from thgutil.i18n import _  from thgutil import hglib, shlib, paths
Change 1 of 1 Show Entire File hggtk/​status.py Stacked
 
14
15
16
17
 
18
19
20
 
14
15
16
 
17
18
19
20
@@ -14,7 +14,7 @@
 import pango  import gobject   -from mercurial import cmdutil, util, ui, hg, commands, patch, mdiff, extensions +from mercurial import cmdutil, util, commands, patch, mdiff  from mercurial import merge as merge_    from thgutil.i18n import _
Change 1 of 1 Show Entire File hggtk/​synch.py Stacked
 
12
13
14
15
 
16
17
18
 
12
13
14
 
15
16
17
18
@@ -12,7 +12,7 @@
 import os  import urllib   -from mercurial import hg, ui, util, extensions, url +from mercurial import hg, ui, extensions, url    from thgutil.i18n import _  from thgutil import hglib, shlib, paths
Change 1 of 1 Show Entire File hggtk/​tagadd.py Stacked
 
8
9
10
11
 
12
13
14
 
8
9
10
 
11
12
13
14
@@ -8,7 +8,7 @@
 import gtk  import traceback   -from mercurial import hg, ui, cmdutil, util +from mercurial import hg, ui, util  from mercurial.node import short, nullid    from thgutil.i18n import _
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
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
 #  # thgshelve.py - commit dialog for TortoiseHg  #  # Copyright 2007 Brad Schick, brad at gmail . com  # Copyright (C) 2007 TK Soh <teekaysoh@gmail.com>  # Copyright (C) 2009 Steve Borho <steve@borho.org>  #    import os  import gtk   -from mercurial import ui, hg -  from thgutil.i18n import _    from status import GStatus, FM_STATUS, FM_CHECKED, DM_CHUNK_ID, DM_REJECTED  import hgshelve    class GShelve(GStatus):   """GTK+ based dialog for displaying repository status and shelving changes.     Also provides related operations like add, delete, remove, revert, refresh,   ignore, diff, and edit.   """     ### Overrides of base class methods ###     def init(self):   GStatus.init(self)   self.mode = 'shelve'     def parse_opts(self):   GStatus.parse_opts(self)   if not self.test_opt('rev'):   self.opts['rev'] = ''     def get_title(self):   root = os.path.basename(self.repo.root)   return ' '.join([root, 'shelve'])     def get_icon(self):   return 'shelve.ico'     def auto_check(self):   if self.test_opt('check'):   for entry in self.filemodel :   if entry[FM_STATUS] in 'MAR':   entry[FM_CHECKED] = True   self._update_check_count()       def save_settings(self):   settings = GStatus.save_settings(self)   settings['gshelve'] = self._vpaned.get_position()   return settings       def load_settings(self, settings):   GStatus.load_settings(self, settings)   if settings:   self._setting_vpos = settings['gshelve']   else:   self._setting_vpos = -1       def get_tbbuttons(self):   tbbuttons = GStatus.get_tbbuttons(self)   tbbuttons.insert(2, gtk.SeparatorToolItem())   self.shelve_btn = self.make_toolbutton(gtk.STOCK_FILE, _('Shelve'),   self._shelve_clicked, tip=_('set aside selected changes'))   self.unshelve_btn = self.make_toolbutton(gtk.STOCK_EDIT, _('Unshelve'),   self._unshelve_clicked, tip=_('restore shelved changes'))   tbbuttons.insert(2, self.unshelve_btn)   tbbuttons.insert(2, self.shelve_btn)   return tbbuttons     def get_body(self):   status_body = GStatus.get_body(self)   vbox = gtk.VBox() # For named shelf collection   self._vpaned = gtk.VPaned()   self._vpaned.add1(vbox)   self._vpaned.add2(status_body)   self._vpaned.set_position(self._setting_vpos)   self._activate_shelve_buttons(True)   return self._vpaned       def get_menu_info(self):   """   Returns menu info in this order:   merge, addrem, unknown, clean, ignored, deleted   """   merge, addrem, unknown, clean, ignored, deleted, unresolved, resolved \   = GStatus.get_menu_info(self)   return (merge + (('_shelve', self._shelve_file),),   addrem + (('_shelve', self._shelve_file),),   unknown + (('_shelve', self._shelve_file),),   clean,   ignored,   deleted + (('_shelve', self._shelve_file),),   unresolved,   resolved,   )       def should_live(self, widget=None, event=None):   return False       def reload_status(self):   if not self._ready: return False   success = GStatus.reload_status(self)   return success     ### End of overridable methods ###     def _has_shelve_file(self):   return os.path.exists(self.repo.join('shelve'))     def _activate_shelve_buttons(self, status):   if status:   self.shelve_btn.set_sensitive(True)   self.unshelve_btn.set_sensitive(self._has_shelve_file())   else:   self.shelve_btn.set_sensitive(False)   self.unshelve_btn.set_sensitive(False)     def _shelve_selected(self, file=None):   # get list of hunks that have not been rejected   chunks = self._shelve_chunks   hlist = [x[DM_CHUNK_ID] for x in self.diff_model if not x[DM_REJECTED]]   if file:   hlist = [cid for cid in hlist if chunks[cid].filename() == file]   if not hlist:   Prompt(_('Shelve'), _('Please select diff chunks to shelve'),   self).run()   return     doforce = False   doappend = False   if self._has_shelve_file():   from gtklib import MessageDialog   dialog = MessageDialog(flags=gtk.DIALOG_MODAL)   dialog.set_title(_('Shelve'))   dialog.set_markup(_('<b>Shelve file exists!</b>'))   dialog.add_buttons(_('Overwrite'), 1,   _('Append'), 2,   _('Cancel'), -1)   dialog.set_transient_for(self)   rval = dialog.run()   dialog.destroy()   if rval == 1:   doforce = True   elif rval == 2:   doappend = True   else:   return     # capture the selected hunks to shelve   fc = []   sc = []   for n, c in enumerate(chunks):   if isinstance(c, hgshelve.header):   if len(fc) > 1 or (len(fc) == 1 and fc[0].binary()):   sc += fc   fc = [c]   elif n in hlist:   fc.append(c)   if len(fc) > 1 or (len(fc) == 1 and fc[0].binary()):   sc += fc     def filter_patch(ui, chunks):   return sc     # shelve them!   self.ui.setconfig('ui', 'interactive', 'on') # hgshelve only works 'interactively'   opts = {'addremove': None, 'include': [], 'force': doforce,   'append': doappend, 'exclude': []}   hgshelve.filterpatch = filter_patch   hgshelve.shelve(self.ui, self.repo, **opts)   self.reload_status()     def _unshelve(self):   opts = {'addremove': None, 'include': [], 'force': None,   'append': None, 'exclude': [], 'inspect': None}   try:   self.ui.quiet = True   hgshelve.unshelve(self.ui, self.repo, **opts)   self.ui.quiet = False   self.reload_status()   except:   pass     def _shelve_clicked(self, toolbutton, data=None):   self._shelve_selected()   self._activate_shelve_buttons(True)     def _unshelve_clicked(self, toolbutton, data=None):   self._unshelve()   self._activate_shelve_buttons(True)     def _shelve_file(self, stat, file):   self._shelve_selected(file)   self._activate_shelve_buttons(True)   return True    def run(_ui, *pats, **opts):   cmdoptions = {   'user':opts.get('user', ''), 'date':opts.get('date', ''),   'logfile':'', 'message':'',   'modified':True, 'added':True, 'removed':True, 'deleted':True,   'unknown':True, 'ignored':False,   'exclude':[], 'include':[],   'check': True, 'git':False, 'addremove':False,   }   return GShelve(_ui, None, None, pats, cmdoptions)
Change 1 of 1 Show Entire File hggtk/​update.py Stacked
 
5
6
7
8
9
10
11
12
 
13
14
15
16
17
18
19
20
21
 
5
6
7
 
8
9
 
 
10
11
12
13
14
15
 
16
17
18
@@ -5,17 +5,14 @@
 #    import os -import sys  import gtk   -from mercurial import util, hg, ui -from mercurial.node import short, nullrev +from mercurial import hg, ui    from thgutil.i18n import _  from thgutil import hglib, paths    import hgcmd -import gdialog  import gtklib    _branch_tip_ = _('= Current Branch Tip =')
Change 1 of 1 Show Entire File hggtk/​visdiff.py Stacked
 
16
17
18
19
 
20
21
22
 
16
17
18
 
19
20
21
22
@@ -16,7 +16,7 @@
 import tempfile    from mercurial.node import short -from mercurial import hg, ui, cmdutil, util, commands +from mercurial import hg, ui, cmdutil, util    from thgutil.i18n import _  from thgutil import hglib, shlib, paths