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

hggtk: use 'from hggtk' to import hggtk modules

Changeset d0eacc88f1a3

Parent 08ac1319a4a0

by Steve Borho

Changes to 27 files · Browse files at d0eacc88f1a3 Showing diff from parent 08ac1319a4a0 Diff from another changeset...

Change 1 of 1 Show Entire File hggtk/​about.py Stacked
 
7
8
9
10
11
12
13
14
 
15
16
17
 
7
8
9
 
10
11
12
13
14
15
16
17
@@ -7,11 +7,11 @@
 import os  import sys  import gtk -import gtklib  from thgutil.i18n import _  from thgutil.hglib import hgversion  from thgutil import shlib  from thgutil import paths +from hggtk import gtklib    def browse_url(url):   import threading
Change 1 of 1 Show Changes Only hggtk/​backout.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
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
 #  # backout.py - TortoiseHg's dialog for backing out changeset  #  # Copyright (C) 2008 Steve Borho <steve@borho.org>  # Copyright (C) 2007 TK Soh <teekaysoh@gmail.com>  #    import os  import gtk  import gobject  import pango    from mercurial import hg, ui  from thgutil.i18n import _  from thgutil import hglib, paths -import gtklib +from hggtk import gtklib    class BackoutDialog(gtk.Window):   """ Backout effect of a changeset """   def __init__(self, rev=None):   """ Initialize the Dialog """   gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)   gtklib.set_tortoise_keys(self)     self.set_title(_('Backout changeset - ') + rev)   self.set_default_size(600, 400)   self.notify_func = None     try:   repo = hg.repository(ui.ui(), path=paths.find_root())   except hglib.RepoError:   gobject.idle_add(self.destroy)   return     vbox = gtk.VBox()   self.add(vbox)     frame = gtk.Frame(_('Changeset Description'))   lbl = gtk.Label()   desc = self.revdesc(repo, rev)   lbl.set_markup(desc)   lbl.set_alignment(0, 0)   frame.add(lbl)   frame.set_border_width(5)   vbox.pack_start(frame, False, False, 2)     self.logview = gtk.TextView(buffer=None)   self.logview.set_editable(True)   self.logview.modify_font(pango.FontDescription('Monospace'))   buf = self.logview.get_buffer()   buf.set_text(_('Backed out changeset: ') + rev)   scrolledwindow = gtk.ScrolledWindow()   scrolledwindow.set_shadow_type(gtk.SHADOW_ETCHED_IN)   scrolledwindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)   scrolledwindow.add(self.logview)   scrolledwindow.set_border_width(4)   frame = gtk.Frame(_('Backout commit message'))   frame.set_border_width(4)   frame.add(scrolledwindow)   self.tips = gtk.Tooltips()   self.tips.set_tip(frame,   _('Commit message text for new changeset that reverses the'   ' effect of the change being backed out.'))   vbox.pack_start(frame, True, True, 4)     accelgroup = gtk.AccelGroup()   self.add_accel_group(accelgroup)   mod = gtklib.get_thg_modifier()     hbbox = gtk.HButtonBox()   hbbox.set_layout(gtk.BUTTONBOX_END)   vbox.pack_start(hbbox, False, False, 2)     close = gtk.Button(_('Close'))   close.connect('clicked', lambda x: self.destroy())   key, modifier = gtk.accelerator_parse('Escape')   close.add_accelerator('clicked', accelgroup, key, 0,   gtk.ACCEL_VISIBLE)   hbbox.add(close)     backout = gtk.Button(_('Backout'))   key, modifier = gtk.accelerator_parse(mod+'Return')   backout.add_accelerator('clicked', accelgroup, key, modifier,   gtk.ACCEL_VISIBLE)   hbbox.add(backout)   backout.grab_focus()     backout.connect('clicked', self.backout, buf, rev)     def revdesc(self, repo, revid):   ctx = repo.changectx(revid)   revstr = str(ctx.rev())   summary = ctx.description().replace('\0', '')   summary = summary.split('\n')[0]   escape = gobject.markup_escape_text   desc = '<b>rev</b>\t\t: %s\n' % escape(revstr)   desc += '<b>summary</b>\t: %s\n' % escape(summary[:80])   desc += '<b>user</b>\t\t: %s\n' % escape(ctx.user())   desc += '<b>date</b>\t\t: %s\n' % escape(hglib.displaytime(ctx.date()))   node = repo.lookup(revid)   tags = repo.nodetags(node)   desc += '<b>branch</b>\t: ' + escape(ctx.branch())   if tags:   desc += '\n<b>tags</b>\t\t: ' + escape(', '.join(tags))   return hglib.toutf(desc)     def set_notify_func(self, func, *args):   self.notify_func = func   self.notify_args = args     def backout(self, button, buf, revstr):   start, end = buf.get_bounds()   msg = buf.get_text(start, end)   cmdline = ['hg', 'backout', '--rev', revstr, '--message', msg]   from hgcmd import CmdDialog   dlg = CmdDialog(cmdline)   dlg.show_all()   dlg.run()   dlg.hide()   if dlg.returncode == 0:   if self.notify_func:   self.notify_func(self.notify_args)   self.destroy()
 
11
12
13
14
15
 
 
16
17
18
 
11
12
13
 
 
14
15
16
17
18
@@ -11,8 +11,8 @@
 from mercurial import extensions  from thgutil.i18n import _  from thgutil import shlib -from gdialog import GDialog -from about import hgversion +from hggtk.gdialog import GDialog +from hggtk.about import hgversion    class BugReport(GDialog):   """GTK+ based dialog for displaying traceback info to the user in a
 
17
18
19
20
21
 
 
22
23
24
 
17
18
19
 
 
20
21
22
23
24
@@ -17,8 +17,8 @@
 from thgutil.hglib import *  from thgutil import shlib   -from gdialog import GDialog, Confirm, NativeSaveFileDialogWrapper -import gtklib +from hggtk.gdialog import GDialog, Confirm, NativeSaveFileDialogWrapper +from hggtk import gtklib    class ChangeSet(GDialog):   """GTK+ based dialog for displaying repository logs
Change 1 of 1 Show Entire File hggtk/​clone.py Stacked
 
10
11
12
13
14
 
 
15
16
17
 
10
11
12
 
 
13
14
15
16
17
@@ -10,8 +10,8 @@
 from mercurial import ui, util  from thgutil.i18n import _  from thgutil import shlib -import gdialog -import gtklib +from hggtk import gdialog +from hggtk import gtklib    class CloneDialog(gtk.Window):   """ Dialog to clone a Mercurial repo """
Change 1 of 1 Show Entire File hggtk/​commit.py Stacked
 
21
22
23
24
25
26
27
 
 
 
 
28
29
30
 
21
22
23
 
 
 
 
24
25
26
27
28
29
30
@@ -21,10 +21,10 @@
 from thgutil import hglib  from thgutil import shlib   -from status import GStatus, FM_STATUS, FM_CHECKED, FM_PATH_UTF8 -from status import DM_REJECTED, DM_CHUNK_ID -import gtklib -import gdialog +from hggtk.status import GStatus, FM_STATUS, FM_CHECKED, FM_PATH_UTF8 +from hggtk.status import DM_REJECTED, DM_CHUNK_ID +from hggtk import gtklib +from hggtk import gdialog    class BranchOperationDialog(gtk.Dialog):   def __init__(self, branch, close):
Change 1 of 1 Show Entire File hggtk/​datamine.py Stacked
 
20
21
22
23
24
 
 
25
26
27
 
20
21
22
 
 
23
24
25
26
27
@@ -20,8 +20,8 @@
 from logview.colormap import AnnotateColorMap, AnnotateColorSaturation  from logview.treeview import TreeView as LogTreeView   -import gtklib -import gdialog +from hggtk import gtklib +from hggtk import gdialog    class DataMineDialog(gdialog.GDialog):   COL_REVID = 0
Change 1 of 1 Show Entire File hggtk/​dialog.py Stacked
 
16
17
18
19
 
20
21
22
 
16
17
18
 
19
20
21
22
@@ -16,7 +16,7 @@
   import gtk  from thgutil.i18n import _ -import gtklib +from hggtk import gtklib    def entry_dialog(parent, msg, visible=True, default='', respfunc=None):   """ Allow a user to enter a text string (username/password)
Change 1 of 1 Show Entire File hggtk/​gdialog.py Stacked
 
24
25
26
27
 
28
29
30
 
24
25
26
 
27
28
29
30
@@ -24,7 +24,7 @@
 from thgutil.i18n import _  from thgutil import shlib, hglib, paths   -import gtklib +from hggtk import gtklib    class SimpleMessage(gtklib.MessageDialog):   def run(self):
Change 1 of 1 Show Entire File hggtk/​guess.py Stacked
 
18
19
20
21
 
22
23
24
 
18
19
20
 
21
22
23
24
@@ -18,7 +18,7 @@
 from thgutil.hglib import toutf, fromutf, diffexpand, RepoError  from thgutil import shlib, paths, thread2   -import gtklib +from hggtk import gtklib    # This function and some key bits below borrowed ruthelessly from  # Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
Change 1 of 1 Show Entire File hggtk/​hgcmd.py Stacked
 
14
15
16
17
18
 
 
19
20
21
 
14
15
16
 
 
17
18
19
20
21
@@ -14,8 +14,8 @@
 from thgutil import shlib  from thgutil import hglib   -import gtklib -import hgthread +from hggtk import gtklib +from hggtk import hgthread    class CmdDialog(gtk.Dialog):   def __init__(self, cmdline, progressbar=True, width=520, height=400):
Change 1 of 1 Show Entire File hggtk/​hgemail.py Stacked
 
18
19
20
21
22
 
 
23
24
25
 
18
19
20
 
 
21
22
23
24
25
@@ -18,8 +18,8 @@
 from thgutil import hglib  from thgutil import shlib   -import gtklib -import dialog +from hggtk import gtklib +from hggtk import dialog    class EmailDialog(gtk.Window):   """ Send patches or bundles via email """
Change 1 of 1 Show Entire File hggtk/​hgignore.py Stacked
 
13
14
15
16
 
17
18
19
 
13
14
15
 
16
17
18
19
@@ -13,7 +13,7 @@
 from thgutil.i18n import _  from thgutil import shlib, hglib, paths   -import gtklib +from hggtk import gtklib    class HgIgnoreDialog(gtk.Window):   'Edit a reposiory .hgignore file'
Change 1 of 1 Show Entire File hggtk/​hginit.py Stacked
 
13
14
15
16
17
 
 
18
19
20
 
13
14
15
 
 
16
17
18
19
20
@@ -13,8 +13,8 @@
 from thgutil import hglib  from thgutil import shlib   -import dialog -import gtklib +from hggtk import dialog +from hggtk import gtklib    class InitDialog(gtk.Window):   """ Dialog to initialize a Mercurial repo """
Change 1 of 1 Show Entire File hggtk/​hgthread.py Stacked
 
18
19
20
21
22
 
 
23
24
25
 
18
19
20
 
 
21
22
23
24
25
@@ -18,8 +18,8 @@
 from thgutil import shlib  from thgutil import thread2   -import dialog -import gdialog +from hggtk import dialog +from hggtk import gdialog    class GtkUi(ui.ui):   '''
Change 1 of 1 Show Entire File hggtk/​history.py Stacked
 
22
23
24
25
 
26
27
28
 
22
23
24
 
25
26
27
28
@@ -22,7 +22,7 @@
 from logview import treemodel  from logview.treeview import TreeView as LogTreeView   -import gtklib +from hggtk import gtklib    def create_menu(label, callback):   menuitem = gtk.MenuItem(label, True)
 
13
14
15
16
 
17
18
19
 
13
14
15
 
16
17
18
19
@@ -13,7 +13,7 @@
 from thgutil.i18n import _  from thgutil import hglib   -import gtklib +from hggtk import gtklib    class FilterDialog(gtk.Dialog):   """ Dialog for creating log filters """
Change 1 of 1 Show Entire File hggtk/​merge.py Stacked
 
13
14
15
16
17
18
 
 
 
19
20
21
 
13
14
15
 
 
 
16
17
18
19
20
21
@@ -13,9 +13,9 @@
 from thgutil.i18n import _  from thgutil import hglib, paths   -import gtklib -import gdialog -import hgcmd +from hggtk import gtklib +from hggtk import gdialog +from hggtk import hgcmd    class MergeDialog(gtk.Window):   """ Dialog to merge revisions of a Mercurial repo """
Change 1 of 1 Show Entire File hggtk/​recovery.py Stacked
 
16
17
18
19
20
21
22
 
23
24
25
 
16
17
18
 
 
 
 
19
20
21
22
@@ -16,10 +16,7 @@
 from thgutil.i18n import _  from thgutil import hglib, shlib, paths   -import gdialog -import dialog -import gtklib -import hgthread +from hggtk import gdialog, dialog, gtklib, hgthread    class RecoveryDialog(gtk.Window):   def __init__(self):
Change 1 of 1 Show Entire File hggtk/​serve.py Stacked
 
22
23
24
25
26
27
 
28
29
30
 
22
23
24
 
 
 
25
26
27
28
@@ -22,9 +22,7 @@
 from thgutil.i18n import _  from thgutil import hglib, paths   -import dialog -import gdialog -import gtklib +from hggtk import dialog, gdialog, gtklib    gservice = None  class ServeDialog(gtk.Window):
Change 1 of 1 Show Entire File hggtk/​status.py Stacked
 
20
21
22
23
24
25
26
 
 
27
28
29
 
20
21
22
 
 
 
 
23
24
25
26
27
@@ -20,10 +20,8 @@
 from thgutil.i18n import _  from thgutil import hglib, shlib, paths   -from gdialog import GDialog, Confirm, Prompt, NativeSaveFileDialogWrapper -import dialog -import hgshelve -import gtklib +from hggtk.gdialog import GDialog, Confirm, Prompt, NativeSaveFileDialogWrapper +from hggtk import dialog, hgshelve, gtklib    # file model row enumerations  FM_CHECKED = 0
Change 1 of 1 Show Entire File hggtk/​synch.py Stacked
 
17
18
19
20
21
22
 
23
24
25
 
17
18
19
 
 
 
20
21
22
23
@@ -17,9 +17,7 @@
 from thgutil.i18n import _  from thgutil import hglib, shlib, paths   -import dialog -import gtklib -import hgthread +from hggtk import dialog, gtklib, hgthread    class SynchDialog(gtk.Window):   def __init__(self, repos=[], pushmode=False):
Change 1 of 1 Show Entire File hggtk/​tagadd.py Stacked
 
14
15
16
17
18
 
19
20
21
 
14
15
16
 
 
17
18
19
20
@@ -14,8 +14,7 @@
 from thgutil.i18n import _  from thgutil import hglib   -import dialog -import gtklib +from hggtk import dialog, gtklib    class TagAddDialog(gtk.Window):   """ Dialog to add tag to Mercurial repo """
 
16
17
18
19
20
21
 
22
23
24
 
16
17
18
 
 
 
19
20
21
22
@@ -16,9 +16,7 @@
 from thgutil.i18n import _  from thgutil import hglib, shlib, paths, iniparse   -import dialog -import gdialog -import gtklib +from hggtk import dialog, gdialog, gtklib    _unspecstr = _('<unspecified>')  
 
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 -import hgshelve +from hggtk import hgshelve    class GShelve(GStatus):   """GTK+ based dialog for displaying repository status and shelving changes.
Change 1 of 1 Show Entire File hggtk/​update.py Stacked
 
12
13
14
15
16
 
17
18
19
 
12
13
14
 
 
15
16
17
18
@@ -12,8 +12,7 @@
 from thgutil.i18n import _  from thgutil import hglib, paths   -import hgcmd -import gtklib +from hggtk import hgcmd, gtklib    _branch_tip_ = _('= Current Branch Tip =')  
Change 1 of 1 Show Entire File hggtk/​visdiff.py Stacked
 
21
22
23
24
25
 
26
27
28
 
21
22
23
 
 
24
25
26
27
@@ -21,8 +21,7 @@
 from thgutil.i18n import _  from thgutil import hglib, shlib, paths   -import gdialog -import gtklib +from hggtk import gdialog, gtklib    try:   import win32con