Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.7, 0.7.1, and 0.7.2

hggtk: last round of pychecker driven cleanups

Changeset 706bb6258a1c

Parent c306df22c254

by Steve Borho

Changes to 17 files · Browse files at 706bb6258a1c Showing diff from parent c306df22c254 Diff from another changeset...

Change 1 of 1 Show Entire File hggtk/​about.py Stacked
 
10
11
12
13
14
15
16
17
 
10
11
12
 
 
13
14
15
@@ -10,8 +10,6 @@
 import pygtk  pygtk.require('2.0')  import gtk -import gobject -import pango  import shlib    try:
Change 1 of 1 Show Entire File hggtk/​backout.py Stacked
 
6
7
8
9
10
11
12
 
6
7
8
 
9
10
11
@@ -6,7 +6,6 @@
 #    import os -import sys  import gtk  import pango  from dialog import *
 
5
6
7
8
9
10
11
12
 
712
713
714
715
716
717
 
 
 
718
719
720
 
5
6
7
 
 
8
9
10
 
710
711
712
 
 
 
713
714
715
716
717
718
@@ -5,8 +5,6 @@
 #    import os -import subprocess -  import pygtk  pygtk.require('2.0')  import gtk @@ -712,9 +710,9 @@
  self.glog_parent.graphview.refresh(True, None, opts)   else:   # Else launch our own GLog instance - from history import GLog - dialog = GLog(self.ui, self.repo, self.cwd, [self.repo.root], - {}, False) + import history + dialog = history.GLog(self.ui, self.repo, self.cwd, + [self.repo.root], {}, False)   dialog.open_with_file(self.curfile)   dialog.display()  
Change 1 of 1 Show Entire File hggtk/​clone.py Stacked
 
218
219
220
221
 
222
223
224
 
218
219
220
 
221
222
223
224
@@ -218,7 +218,7 @@
  def _btn_rev_clicked(self, button):   """ select revision from history dialog """   import histselect - rev = histselect.select(self.root) + rev = histselect.select()   if rev is not None:   self._rev_input.set_text(rev)  
Change 1 of 2 Show Entire File hggtk/​commit.py Stacked
 
292
293
294
295
296
297
298
 
520
521
522
523
 
524
525
526
 
527
528
529
 
292
293
294
 
295
296
297
 
519
520
521
 
522
523
524
 
525
526
527
528
@@ -292,7 +292,6 @@
  return True     def _commit_selected(self, files): - import hgshelve   # 1a. get list of chunks not rejected   repo, chunks, ui = self.repo, self._shelve_chunks, self.ui   model = self.diff_model @@ -520,10 +519,10 @@
  from hglib import thgdispatch   args = ['--repository', root, ct]   try: - ret = thgdispatch(repo.ui, args=args) + thgdispatch(repo.ui, args=args)   except SystemExit:   pass - return None + return     cmdoptions = {   'user':'', 'date':'',
Change 1 of 1 Show Entire File hggtk/​datamine.py Stacked
 
11
12
13
14
15
16
17
 
11
12
13
 
14
15
16
@@ -11,7 +11,6 @@
 import pango  import Queue  import threading, thread2 -import time  from mercurial import hg, ui, util, revlog  from hglib import hgcmd_toq, toutf, fromutf, gettabwidth, displaytime, LookupError, rootpath  from gdialog import *
Change 1 of 3 Show Entire File hggtk/​gdialog.py Stacked
 
59
60
61
62
63
 
 
64
65
66
 
231
232
233
234
 
235
236
237
238
239
 
 
240
241
242
 
488
489
490
491
492
493
494
495
 
 
 
 
 
496
497
498
 
59
60
61
 
 
62
63
64
65
66
 
231
232
233
 
234
235
236
237
 
 
238
239
240
241
242
 
488
489
490
 
 
 
 
 
491
492
493
494
495
496
497
498
@@ -59,8 +59,8 @@
  primary = '<b>' + primary + '</b>'   self.set_markup(toutf(primary))   message = '' - for i, file in enumerate(files): - message += ' ' + file + '\n' + for i, f in enumerate(files): + message += ' ' + f + '\n'   if i == 9:   message += ' ...\n'   break @@ -231,12 +231,12 @@
      def global_opts(self): - globals = {} + globalopts = {}   hgglobals = [opt[1].replace('-', '_') for opt in commands.globalopts if opt[1] != 'help']   for key in self.opts:   if key in hgglobals : - globals[key] = self.opts[key] - return globals + globalopts[key] = self.opts[key] + return globalopts       def count_revs(self): @@ -488,11 +488,11 @@
  return False     def runWindows(self): - import win32gui, win32con, os - filter = "" - for name, pattern in self.Filter.iteritems(): - filter += name + "\0" + pattern + "\0" - customfilter = "\0" + import win32gui, win32con + #filter = "" + #for name, pattern in self.Filter.iteritems(): + # filter += name + "\0" + pattern + "\0" + #customfilter = "\0"     fname, customfilter, flags=win32gui.GetSaveFileNameW(   InitialDir=self.InitialDir,
Change 1 of 1 Show Entire File hggtk/​gtools.py Stacked
 
47
48
49
50
51
52
53
54
55
56
57
58
59
 
47
48
49
 
50
51
52
53
 
 
54
55
56
@@ -47,13 +47,10 @@
 import mercurial.demandimport; mercurial.demandimport.disable()    import os -import sys    import pygtk  pygtk.require('2.0')  import gtk -import gobject -import pango    from mercurial.i18n import _  from mercurial.node import *
Change 1 of 1 Show Entire File hggtk/​hgemail.py Stacked
 
9
10
11
12
13
14
15
 
9
10
11
 
12
13
14
@@ -9,7 +9,6 @@
 import sys  import gtk  import pango -import shelve  import shlib  from tempfile import mkstemp  from dialog import *
Change 1 of 1 Show Entire File hggtk/​hgignore.py Stacked
 
158
159
160
161
 
162
163
164
 
158
159
160
 
161
162
163
164
@@ -158,7 +158,7 @@
  try:   l = open(repo.wjoin('.hgignore'), 'rb').readlines()   self.doseoln = l[0].endswith('\r\n') - except (IOError, ValueError), e: + except (IOError, ValueError):   self.doseoln = os.name == 'nt'   l = []  
Change 1 of 1 Show Entire File hggtk/​hginit.py Stacked
 
8
9
10
11
12
13
14
 
8
9
10
 
11
12
13
@@ -8,7 +8,6 @@
 pygtk.require("2.0")  import os  import gtk -import pango  from dialog import error_dialog, info_dialog  from mercurial import hg, ui, util  from hglib import RepoError
Change 1 of 2 Show Entire File hggtk/​hglib.py Stacked
 
85
86
87
88
 
89
90
91
 
372
373
374
375
 
376
377
378
 
85
86
87
 
88
89
90
91
 
372
373
374
 
375
376
377
378
@@ -85,7 +85,7 @@
  tabwidth = int(tabwidth)   if tabwidth < 1 or tabwidth > 16:   tabwidth = 0 - except (ValueError, TypeError), e: + except (ValueError, TypeError):   tabwidth = 0   _tabwidth = tabwidth   return tabwidth @@ -372,7 +372,7 @@
  # Run actual command   try:   ret = d() - except TypeError, inst: + except TypeError:   # was this an argument error?   tb = traceback.extract_tb(sys.exc_info()[2])   if len(tb) != 2: # no
Change 1 of 3 Show Entire File hggtk/​history.py Stacked
 
229
230
231
232
 
233
234
235
 
276
277
278
279
280
281
282
 
482
483
484
485
486
487
488
489
 
490
491
492
 
229
230
231
 
232
233
234
235
 
276
277
278
 
279
280
281
 
481
482
483
 
 
 
484
485
486
487
488
489
@@ -229,7 +229,7 @@
  l = int(limit)   if l > 0:   return l - except (TypeError, ValueError), e: + except (TypeError, ValueError):   pass   return l or 500   @@ -276,7 +276,6 @@
  self.opts['revrange'] = filteropts.get('revrange', None)   self.opts['date'] = filteropts.get('date', None)   self.opts['keyword'] = filteropts.get('keyword', []) - revs = []   if filteropts:   branch = filteropts.get('branch', None)   if 'revrange' in filteropts or 'branch' in filteropts: @@ -482,11 +481,9 @@
  def _add_tag(self, menuitem):   from tagadd import TagAddDialog   - rev = self.currow[treemodel.REVID] - parents = self.currow[treemodel.PARENTS] -   # save tag info for detecting new tags added   oldtags = self.repo.tagslist() + rev = self.currow[treemodel.REVID]     def refresh(*args):   self.repo.invalidate()
 
194
195
196
197
 
 
198
199
 
200
201
202
 
206
207
208
209
210
211
212
 
 
 
 
213
214
215
 
194
195
196
 
197
198
199
 
200
201
202
203
 
207
208
209
 
 
 
 
210
211
212
213
214
215
216
@@ -194,9 +194,10 @@
  opts['keyword'] = [w.strip() for w in kw.split(',')]   if date:   try: - df = util.matchdate(date) + # return of matchdate not used, just sanity checking + util.matchdate(date)   opts['date'] = date - except Exception, e: + except (ValueError, util.Abort), e:   Prompt('Invalid date specification', str(e), self).run()   self.dateentry.grab_focus()   return @@ -206,10 +207,10 @@
  if not rev1:   rev1 = rev0   try: - range = cmdutil.revrange(self.repo, [rev0, rev1]) - range.sort() - range.reverse() - opts['revrange'] = range + 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()
Change 1 of 2 Show Entire File hggtk/​rename.py Stacked
 
12
13
14
15
 
16
17
18
 
30
31
32
33
34
35
36
 
12
13
14
 
15
16
17
18
 
30
31
32
 
33
34
35
@@ -12,7 +12,7 @@
 import cStringIO  import shlib  import Queue -import threading, thread2 +import thread2  from dialog import error_dialog  from mercurial import hg, ui, mdiff, cmdutil, match, util, commands  from hglib import toutf, diffexpand, rootpath @@ -30,7 +30,6 @@
  ctx = repo['.']   for r in removed:   rr = ctx.filectx(r).data() - bestname, bestscore = None, threshold   for a in added:   aa = repo.wread(a)   if aa == rr:
 
11
12
13
14
15
16
17
18
 
11
12
13
 
 
14
15
16
@@ -11,8 +11,6 @@
  pass    import gtk -import gobject -import pango  from mercurial import hg, ui, cmdutil, util  from mercurial.i18n import _  from mercurial.node import *
Change 1 of 1 Show Entire File hggtk/​status.py Stacked
 
522
523
524
525
526
527
528
 
522
523
524
 
525
526
527
@@ -522,7 +522,6 @@
  self._node1, self._node2 = cmdutil.revpair(self.repo, self.opts.get('rev'))     matcher = cmdutil.match(self.repo, self.pats, self.opts) - cwd = (self.pats and self.repo.getcwd()) or ''   status = [n for n in self.repo.status(node1=self._node1, node2=self._node2,   match=matcher,   ignored=self.test_opt('ignored'),