Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.9, 0.9.1, and 0.9.1.1

hggtk, thgutil: move Python packages under tortoisehg

During the move, take the opportunity to rename hggtk->hgtk and thgutil->util
This serves two purposes, to make us better Python citizens and to dogfood our
support for renames.

Changeset db36d1f7e96a

Parent 61482ea34fd0

by Steve Borho

Changes to 64 files · Browse files at db36d1f7e96a Showing diff from parent 61482ea34fd0 Diff from another changeset...

 
35
36
37
38
 
39
40
41
42
43
44
 
 
45
46
47
 
62
63
64
65
 
66
67
68
 
35
36
37
 
38
39
40
41
42
 
 
43
44
45
46
47
 
62
63
64
 
65
66
67
68
@@ -35,13 +35,13 @@
  pfile = pfile[:-1]   path = os.path.dirname(os.path.dirname(os.path.realpath(pfile)))   thgpath = os.path.normpath(path) - testpath = os.path.join(thgpath, 'thgutil') + testpath = os.path.join(thgpath, 'tortoisehg')   if os.path.isdir(testpath) and thgpath not in sys.path:   sys.path.insert(0, thgpath)  _thg_path()   -from thgutil import paths, debugthg, hglib, cachethg -from hggtk import gtklib +from tortoisehg.util import paths, debugthg, hglib, cachethg +from tortoisehg.hgtk import gtklib    if debugthg.debug('N'):   debugf = debugthg.debugf @@ -62,7 +62,7 @@
  self.allvfs = {}   self.inv_dirs = set()   - from thgutil import menuthg + from tortoisehg.util import menuthg   self.hgtk = paths.find_in_path('hgtk')   self.menu = menuthg.menuThg()   self.notify = os.path.expanduser('~/.tortoisehg/notify')
 
35
36
37
38
 
39
40
41
 
62
63
64
65
66
 
 
67
68
69
 
35
36
37
 
38
39
40
41
 
62
63
64
 
 
65
66
67
68
69
@@ -35,7 +35,7 @@
 # Fix for nautilus python extensions in lib64 on x86_64  sed -i "s,lib/nautilus,%{_lib}/nautilus,g" setup.py   -cat > thgutil/config.py << EOT +cat > tortoisehg/util/config.py << EOT  bin_path = "%{_bindir}"  license_path = "%{_docdir}/%{name}-%{version}/COPYING.txt"  locale_path = "%{_datadir}/locale" @@ -62,8 +62,8 @@
 %defattr(-,root,root,-)  %doc COPYING.txt ReleaseNotes.txt doc/build/html/  %{_bindir}/hgtk -%{python_sitelib}/hggtk/ -%{python_sitelib}/thgutil/ +%{python_sitelib}/tortoisehg/hgtk/ +%{python_sitelib}/tortoisehg/util/  %{python_sitelib}/tortoisehg-*.egg-info  %{_datadir}/pixmaps/tortoisehg/  %{_datadir}/locale/*/LC_MESSAGES/tortoisehg.mo
Change 1 of 1 Show Entire File hggtk/​rename.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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
@@ -1,73 +0,0 @@
-# rename.py - TortoiseHg's dialogs for handling renames -# -# Copyright 2009 Steve Borho <steve@borho.org> -# -# This software may be used and distributed according to the terms of the -# GNU General Public License version 2, incorporated herein by reference. - -import sys -import gtk -import cStringIO - -from mercurial import hg, ui, util, commands - -from thgutil.i18n import _ -from thgutil import hglib, paths - -from hggtk import dialog - -def run(ui, *pats, **opts): - fname, target = '', '' - try: - fname = pats[0] - target = pats[1] - except IndexError: - pass - fname = util.normpath(fname) - if target: - target = hglib.toutf(util.normpath(target)) - else: - target = hglib.toutf(fname) - title = _('Rename ') + hglib.toutf(fname) - dlg = dialog.entry_dialog(None, title, True, target, rename_resp) - dlg.orig = fname - return dlg - -def rename_resp(dlg, response): - if response != gtk.RESPONSE_OK: - dlg.destroy() - return - try: - root = paths.find_root() - repo = hg.repository(ui.ui(), root) - except (ImportError, hglib.RepoError): - dlg.destroy() - return - - new_name = hglib.fromutf(dlg.entry.get_text()) - opts = {} - opts['force'] = False # Checkbox? Nah. - opts['after'] = False - opts['dry_run'] = False - - saved = sys.stderr - errors = cStringIO.StringIO() - toquit = False - try: - sys.stderr = errors - repo.ui.pushbuffer() - repo.ui.quiet = True - try: - commands.rename(repo.ui, repo, dlg.orig, new_name, **opts) - toquit = True - except (util.Abort, hglib.RepoError), inst: - dlg.error_dialog(None, _('rename error'), str(inst)) - toquit = False - finally: - sys.stderr = saved - textout = errors.getvalue() + repo.ui.popbuffer() - errors.close() - if len(textout) > 1: - dlg.error_dialog(None, _('rename error'), textout) - elif toquit: - dlg.destroy()
Change 1 of 3 Show Entire File hgtk Stacked
 
11
12
13
14
 
15
16
17
18
19
20
 
21
22
23
 
30
31
32
33
 
34
35
36
37
38
 
39
40
 
41
42
43
 
51
52
53
54
 
55
56
57
58
59
60
 
61
62
63
64
65
66
 
 
67
68
69
 
11
12
13
 
14
15
16
17
18
19
 
20
21
22
23
 
30
31
32
 
33
34
35
36
37
 
38
39
 
40
41
42
43
 
51
52
53
 
54
55
56
57
58
59
 
60
61
62
63
64
 
 
65
66
67
68
69
@@ -11,13 +11,13 @@
   if hasattr(sys, "frozen"):   # Prepend C:\Program Files\TortoiseHg\gtk (equiv) to the path - from thgutil import paths + from tortoisehg.util import paths   gtkpath = os.path.join(paths.bin_path, 'gtk')   os.environ['PATH'] = os.pathsep.join([gtkpath, os.environ['PATH']])  else:   # if hgtk is a symlink, insert symlink target directory in sys.path   thgpath = os.path.dirname(os.path.realpath(__file__)) - testpath = os.path.join(thgpath, 'thgutil') + testpath = os.path.join(thgpath, 'tortoisehg')   if os.path.isdir(testpath) and thgpath not in sys.path:   sys.path.insert(0, thgpath)   @@ -30,14 +30,14 @@
 demandimport.ignore.append('win32com.shell')  demandimport.enable()  from mercurial import ui, util -from thgutil.hgversion import hgversion, checkhgversion +from tortoisehg.util.hgversion import hgversion, checkhgversion  import cStringIO  import traceback    try: - import hggtk.hgtk + import tortoisehg.hgtk.hgtk  except ImportError: - sys.stderr.write("abort: couldn't find hggtk libraries in [%s]\n" % + sys.stderr.write("abort: couldn't find hgtk libraries in [%s]\n" %   ';'.join(sys.path))   sys.stderr.write("(check your install and PYTHONPATH)\n")   sys.exit(-1) @@ -51,19 +51,19 @@
  sys.exit(1)    if not capt or 'THGDEBUG' in os.environ: - sys.exit(hggtk.hgtk.dispatch(sys.argv[1:])) + sys.exit(tortoisehg.hgtk.hgtk.dispatch(sys.argv[1:]))  else:   mystderr = cStringIO.StringIO()   origstderr = sys.stderr   sys.stderr = mystderr   try: - ret = hggtk.hgtk.dispatch(sys.argv[1:]) + ret = tortoisehg.hgtk.hgtk.dispatch(sys.argv[1:])   sys.stderr = origstderr   mystderr.seek(0)   for l in mystderr.readlines():   if l.startswith('Traceback') or l.startswith('TypeError'): - from hggtk.bugreport import run - from hggtk.hgtk import gtkrun + from tortoisehg.hgtk.bugreport import run + from tortoisehg.hgtk.hgtk import gtkrun   error = 'Recoverable runtime error (stderr):\n'   error += mystderr.getvalue()   opts = {}
Change 1 of 4 Show Entire File setup.py Stacked
 
56
57
58
59
 
 
60
61
62
 
128
129
130
131
 
 
132
133
134
 
139
140
141
142
 
143
144
145
 
168
169
170
171
 
172
173
174
175
176
177
178
179
 
 
180
181
182
 
56
57
58
 
59
60
61
62
63
 
129
130
131
 
132
133
134
135
136
 
141
142
143
 
144
145
146
147
 
170
171
172
 
173
174
175
176
177
178
179
 
 
180
181
182
183
184
@@ -56,7 +56,8 @@
  # Specific definitios for Windows NT-alike installations   _scripts = []   _data_files = [] - _packages = ['hggtk', 'hggtk.logview', 'thgutil'] + _packages = ['tortoisehg.hgtk', 'tortoisehg.hgtk.logview', + 'tortoisehg.util']   extra = {}   hgextmods = []   @@ -128,7 +129,8 @@
  # Specific definitios for Posix installations   _extra = {}   _scripts = ['hgtk'] - _packages = ['hggtk', 'hggtk.logview', 'thgutil'] + _packages = ['tortoisehg.hgtk', 'tortoisehg.hgtk.logview', + 'tortoisehg.util']   _data_files = [(os.path.join('share/pixmaps/tortoisehg', root),   [os.path.join(root, file_) for file_ in files])   for root, dirs, files in os.walk('icons')] @@ -139,7 +141,7 @@
  ['contrib/nautilus-thg.py'])]     # Create a config.py. Distributions will need to supply their own - cfgfile = os.path.join('thgutil', 'config.py') + cfgfile = os.path.join('tortoisehg', 'util', 'config.py')   if not os.path.exists(cfgfile) and not os.path.exists('.hg/requires'):   f = open(cfgfile, "w")   f.write('bin_path = "/usr/bin"\n') @@ -168,15 +170,15 @@
 except OSError:   version = "unknown"   -verfile = os.path.join("thgutil", "__version__.py") +verfile = os.path.join('tortoisehg', 'util', '__version__.py')  if version != 'unknown' or not os.path.exists(verfile):   f = file(verfile, "w")   f.write('# this file is autogenerated by setup.py\n')   f.write('version = "%s"\n' % version)   f.close()  else: - import thgutil.__version__ - version = thgutil.__version__.version + import tortoisehg.util.__version__ + version = tortoisehg.util.__version__.version    setup(name="tortoisehg",   version=version,
Change 1 of 3 Show Entire File thgtaskbar.py Stacked
 
24
25
26
27
28
 
 
29
30
31
32
33
34
35
 
45
46
47
48
 
49
50
51
 
172
173
174
175
 
176
177
178
 
24
25
26
 
 
27
28
29
30
31
 
32
33
34
 
44
45
46
 
47
48
49
50
 
171
172
173
 
174
175
176
177
@@ -24,12 +24,11 @@
 demandimport.ignore.append('win32com.shell')  demandimport.enable()  from mercurial import ui, error -from thgutil.i18n import agettext as _ -from thgutil import thread2, paths, shlib +from tortoisehg.util.i18n import agettext as _ +from tortoisehg.util import thread2, paths, shlib    if hasattr(sys, "frozen"):   # Insert PATH to binary installer gtk directory - from thgutil import paths   gtkpath = os.path.join(paths.bin_path, 'gtk')   os.environ['PATH'] = os.pathsep.join([gtkpath, os.environ['PATH']])   # Give stdout/stderr closed attributes to prevent ui.py errors @@ -45,7 +44,7 @@
  # Try and find a custom icon   print "SetIcon(%s)" % name   hinst = GetModuleHandle(None) - from thgutil.paths import get_tortoise_icon + from tortoisehg.util.paths import get_tortoise_icon   iconPathName = get_tortoise_icon(name)   if iconPathName and os.path.isfile(iconPathName):   icon_flags = win32con.LR_LOADFROMFILE | win32con.LR_DEFAULTSIZE @@ -172,7 +171,7 @@
  def launchgui(self):   def launch():   import gtk - from hggtk import taskbarui, hgtk + from tortoisehg.hgtk import taskbarui   dlg = taskbarui.TaskBarUI(logger.getqueue(), requests)   dlg.show_all()   dlg.connect('destroy', gtk.main_quit)
Show Entire File tortoisehg/​__init__.py Stacked
copied from hggtk/__init__.py
(No changes)
Show Entire File tortoisehg/​hgtk/​__init__.py Stacked
renamed from hggtk/__init__.py
(No changes)
Change 1 of 1 Show Entire File tortoisehg/​hgtk/​about.py Stacked
renamed from hggtk/about.py
 
11
12
13
14
15
 
 
16
17
 
18
19
20
 
11
12
13
 
 
14
15
16
 
17
18
19
20
@@ -11,10 +11,10 @@
 import gtk  import threading   -from thgutil.i18n import _ -from thgutil import version, paths, hglib +from tortoisehg.util.i18n import _ +from tortoisehg.util import version, paths, hglib   -from hggtk import gtklib, hgtk +from tortoisehg.hgtk import gtklib, hgtk    def browse_url(url):   def start_browser():
Change 1 of 1 Show Entire File tortoisehg/​hgtk/​archive.py Stacked
renamed from hggtk/archive.py
 
12
13
14
15
16
 
 
17
18
 
19
20
21
 
12
13
14
 
 
15
16
17
 
18
19
20
21
@@ -12,10 +12,10 @@
   from mercurial import hg, ui   -from thgutil.i18n import _ -from thgutil import hglib, paths +from tortoisehg.util.i18n import _ +from tortoisehg.util import hglib, paths   -from hggtk import hgcmd, gtklib +from tortoisehg.hgtk import hgcmd, gtklib    _working_dir_parent_ = _('= Working Directory Parent =')  
Change 1 of 1 Show Entire File tortoisehg/​hgtk/​backout.py Stacked
renamed from hggtk/backout.py
 
12
13
14
15
16
 
 
17
18
 
19
20
21
 
12
13
14
 
 
15
16
17
 
18
19
20
21
@@ -12,10 +12,10 @@
   from mercurial import hg, ui   -from thgutil.i18n import _ -from thgutil import hglib, paths, i18n, settings +from tortoisehg.util.i18n import _ +from tortoisehg.util import hglib, paths, i18n, settings   -from hggtk import changesetinfo, gtklib, hgcmd, gdialog +from tortoisehg.hgtk import changesetinfo, gtklib, hgcmd, gdialog    keep = i18n.keepgettext()  
Change 1 of 1 Show Entire File tortoisehg/​hgtk/​bugreport.py Stacked
renamed from hggtk/bugreport.py
 
10
11
12
13
14
15
 
 
 
16
17
18
 
10
11
12
 
 
 
13
14
15
16
17
18
@@ -10,9 +10,9 @@
 import pango    from mercurial import extensions -from thgutil.i18n import _ -from thgutil import hglib, version -from hggtk import gdialog +from tortoisehg.util.i18n import _ +from tortoisehg.util import hglib, version +from tortoisehg.hgtk import gdialog    class BugReport(gdialog.GDialog):   """GTK+ based dialog for displaying traceback info to the user in a
Change 1 of 3 Show Entire File tortoisehg/​hgtk/​changeset.py Stacked
renamed from hggtk/changeset.py
 
13
14
15
16
17
18
 
 
 
19
20
 
21
22
23
 
677
678
679
680
 
681
682
683
 
694
695
696
697
 
698
699
700
 
13
14
15
 
 
 
16
17
18
19
 
20
21
22
23
 
677
678
679
 
680
681
682
683
 
694
695
696
 
697
698
699
700
@@ -13,11 +13,11 @@
   from mercurial import cmdutil, context, util, ui, hg, patch, mdiff   -from thgutil.i18n import _ -from thgutil.hglib import * -from thgutil import shlib +from tortoisehg.util.i18n import _ +from tortoisehg.util.hglib import * +from tortoisehg.util import shlib   -from hggtk import gdialog, gtklib, hgcmd +from tortoisehg.hgtk import gdialog, gtklib, hgcmd    class ChangeSet(gdialog.GDialog):   'GTK+ based dialog for displaying repository logs' @@ -677,7 +677,7 @@
    def ann_file(self, menuitem):   'User selected annotate file from the file list context menu' - from hggtk import datamine + from tortoisehg.hgtk import datamine   rev = self.currev   dialog = datamine.DataMineDialog(self.ui, self.repo, self.cwd, [], {})   dialog.display() @@ -694,7 +694,7 @@
  self.glog_parent.reload_log(**opts)   else:   # Else launch our own glog instance - from hggtk import history + from tortoisehg.hgtk import history   dlg = history.run(self.ui, filehist=self.curfile)   dlg.display()  
Change 1 of 1 Show Entire File tortoisehg/​hgtk/​changesetinfo.py Stacked
renamed from hggtk/changesetinfo.py
 
10
11
12
13
14
 
 
15
16
 
17
18
19
 
10
11
12
 
 
13
14
15
 
16
17
18
19
@@ -10,10 +10,10 @@
 import os  import gtk   -from thgutil.i18n import _ -from thgutil import hglib +from tortoisehg.util.i18n import _ +from tortoisehg.util import hglib   -from hggtk import gtklib +from tortoisehg.hgtk import gtklib    def changesetinfo(repo, revid, head=False):   def lbl(str, bold=False, right=False):
Change 1 of 1 Show Entire File tortoisehg/​hgtk/​clone.py Stacked
renamed from hggtk/clone.py
 
12
13
14
15
16
17
 
 
 
18
19
20
 
12
13
14
 
 
 
15
16
17
18
19
20
@@ -12,9 +12,9 @@
 import traceback    from mercurial import ui, util -from thgutil.i18n import _ -from thgutil import hglib, shlib, settings -from hggtk import gdialog, gtklib, hgcmd +from tortoisehg.util.i18n import _ +from tortoisehg.util import hglib, shlib, settings +from tortoisehg.hgtk import gdialog, gtklib, hgcmd    class CloneDialog(gtk.Dialog):   """ Dialog to clone a Mercurial repo """
Change 1 of 2 Show Entire File tortoisehg/​hgtk/​commit.py Stacked
renamed from hggtk/commit.py
 
18
19
20
21
22
 
 
23
24
25
26
 
 
27
28
29
 
745
746
747
748
 
749
750
751
 
18
19
20
 
 
21
22
23
 
 
 
24
25
26
27
28
 
744
745
746
 
747
748
749
750
@@ -18,12 +18,11 @@
   from mercurial import ui, hg, util, patch, cmdutil   -from thgutil.i18n import _ -from thgutil import shlib, hglib +from tortoisehg.util.i18n import _ +from tortoisehg.util import shlib, hglib   -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, thgconfig, gdialog, hgcmd +from tortoisehg.hgtk.status import GStatus, FM_STATUS, FM_CHECKED, FM_PATH_UTF8 +from tortoisehg.hgtk import gtklib, thgconfig, gdialog, hgcmd    class BranchOperationDialog(gtk.Dialog):   def __init__(self, branch, close, mergebranches): @@ -745,7 +744,7 @@
      def changelog_clicked(self, toolbutton, data=None): - from hggtk import history + from tortoisehg.hgtk import history   dlg = history.run(self.ui)   dlg.display()   return True
Change 1 of 2 Show Entire File tortoisehg/​hgtk/​datamine.py Stacked
renamed from hggtk/datamine.py
 
15
16
17
18
19
20
 
 
21
22
23
24
25
 
 
 
 
26
27
28
 
161
162
163
164
 
165
166
167
 
15
16
17
 
 
 
18
19
20
 
 
 
 
21
22
23
24
25
26
27
 
160
161
162
 
163
164
165
166
@@ -15,14 +15,13 @@
   from mercurial import util   -from thgutil.i18n import _ -from thgutil import hglib -from thgutil import thread2 +from tortoisehg.util.i18n import _ +from tortoisehg.util import hglib, thread2   -from hggtk.logview.colormap import AnnotateColorMap, AnnotateColorSaturation -from hggtk.logview.treeview import TreeView as LogTreeView - -from hggtk import gtklib, gdialog, changeset +from tortoisehg.hgtk.logview.colormap import AnnotateColorMap +from tortoisehg.hgtk.logview.colormap import AnnotateColorSaturation +from tortoisehg.hgtk.logview.treeview import TreeView as LogTreeView +from tortoisehg.hgtk import gtklib, gdialog, changeset    class DataMineDialog(gdialog.GDialog):   COL_REVID = 0 @@ -161,7 +160,7 @@
  self.add_annotate_page(self.curpath, self.currev)     def cmenu_file_log(self, menuitem): - from hggtk import history + from tortoisehg.hgtk import history   dlg = history.run(self.ui, filehist=self.curpath)   dlg.display()  
Change 1 of 1 Show Entire File tortoisehg/​hgtk/​dialog.py Stacked
renamed from hggtk/dialog.py
 
15
16
17
18
19
 
 
20
21
22
 
15
16
17
 
 
18
19
20
21
22
@@ -15,8 +15,8 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA    import gtk -from thgutil.i18n import _ -from hggtk import gtklib +from tortoisehg.util.i18n import _ +from tortoisehg.hgtk 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 4 Show Entire File tortoisehg/​hgtk/​gdialog.py Stacked
renamed from hggtk/gdialog.py
 
17
18
19
20
21
 
 
22
23
 
24
25
26
 
344
345
346
347
 
348
349
350
 
517
518
519
520
 
521
522
523
 
530
531
532
533
 
534
535
536
 
17
18
19
 
 
20
21
22
 
23
24
25
26
 
344
345
346
 
347
348
349
350
 
517
518
519
 
520
521
522
523
 
530
531
532
 
533
534
535
536
@@ -17,10 +17,10 @@
   from mercurial import cmdutil, util, ui, hg, commands   -from thgutil.i18n import _ -from thgutil import settings, hglib, paths +from tortoisehg.util.i18n import _ +from tortoisehg.util import settings, hglib, paths   -from hggtk import gtklib +from tortoisehg.hgtk import gtklib    class SimpleMessage(gtklib.MessageDialog):   def run(self): @@ -344,7 +344,7 @@
  if not url.startswith('http'):   docpath = os.path.dirname(paths.get_license_path())   url = os.path.join(docpath, url) - from hggtk import about + from tortoisehg.hgtk import about   about.browseurl(url)     def launch(self, item, app): @@ -517,7 +517,7 @@
  return True, textout     def _do_diff(self, canonpats, options): - from hggtk import visdiff + from tortoisehg.hgtk import visdiff   options['canonpats'] = canonpats   dialog = visdiff.run(self.ui, **options)   if not dialog: @@ -530,7 +530,7 @@
  self._do_diff(file and [file] or [], self.opts)     def _view_files(self, files, otherparent): - from hggtk import thgconfig + from tortoisehg.hgtk import thgconfig   def cleanup():   shutil.rmtree(self.tmproot)  
Change 1 of 1 Show Entire File tortoisehg/​hgtk/​gorev.py Stacked
renamed from hggtk/gorev.py
 
11
12
13
14
15
 
 
16
17
18
 
11
12
13
 
 
14
15
16
17
18
@@ -11,8 +11,8 @@
 import gobject  import mercurial   -from thgutil.i18n import _ -from hggtk import gtklib, gdialog +from tortoisehg.util.i18n import _ +from tortoisehg.hgtk import gtklib, gdialog      class GotoRevDialog(gtk.Dialog):
Change 1 of 2 Show Entire File tortoisehg/​hgtk/​gtklib.py Stacked
renamed from hggtk/gtklib.py
 
12
13
14
15
16
 
 
17
18
 
19
20
21
 
329
330
331
332
 
333
334
335
 
12
13
14
 
 
15
16
17
 
18
19
20
21
 
329
330
331
 
332
333
334
335
@@ -12,10 +12,10 @@
 import gobject  import pango   -from thgutil.i18n import _ -from thgutil import paths, hglib +from tortoisehg.util.i18n import _ +from tortoisehg.util import paths, hglib   -from hggtk import hgtk +from tortoisehg.hgtk import hgtk    if gtk.gtk_version < (2, 14, 0):   # at least on 2.12.12, gtk widgets can be confused by control @@ -329,7 +329,7 @@
  pass   else:   def selectlang(senderitem): - from hggtk import dialog + from tortoisehg.hgtk import dialog   spell = gtkspell.get_from_text_view(textview)   lang = ''   while True:
Change 1 of 1 Show Entire File tortoisehg/​hgtk/​guess.py Stacked
renamed from hggtk/guess.py
 
15
16
17
18
19
20
 
 
 
21
22
 
23
24
25
 
15
16
17
 
 
 
18
19
20
21
 
22
23
24
25
@@ -15,11 +15,11 @@
   from mercurial import hg, ui, mdiff, cmdutil, match, util   -from thgutil.i18n import _ -from thgutil.hglib import toutf, fromutf, diffexpand, RepoError -from thgutil import shlib, paths, thread2, settings +from tortoisehg.util.i18n import _ +from tortoisehg.util.hglib import toutf, fromutf, diffexpand, RepoError +from tortoisehg.util import shlib, paths, thread2, settings   -from hggtk import gtklib +from tortoisehg.hgtk 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 tortoisehg/​hgtk/​hgcmd.py Stacked
renamed from hggtk/hgcmd.py
 
12
13
14
15
16
 
 
17
18
 
19
20
21
 
12
13
14
 
 
15
16
17
 
18
19
20
21
@@ -12,10 +12,10 @@
 import os  import Queue   -from thgutil.i18n import _ -from thgutil import shlib, hglib +from tortoisehg.util.i18n import _ +from tortoisehg.util import shlib, hglib   -from hggtk import gtklib, hgthread +from tortoisehg.hgtk import gtklib, hgthread    class CmdDialog(gtk.Dialog):   def __init__(self, cmdline, progressbar=True):
Change 1 of 1 Show Entire File tortoisehg/​hgtk/​hgemail.py Stacked
renamed from hggtk/hgemail.py
 
15
16
17
18
19
 
 
20
21
 
22
23
24
 
15
16
17
 
 
18
19
20
 
21
22
23
24
@@ -15,10 +15,10 @@
   from mercurial import hg, ui, extensions   -from thgutil.i18n import _ -from thgutil import hglib, settings +from tortoisehg.util.i18n import _ +from tortoisehg.util import hglib, settings   -from hggtk import gtklib, dialog, thgconfig, hgcmd +from tortoisehg.hgtk import gtklib, dialog, thgconfig, hgcmd    class EmailDialog(gtk.Window):   """ Send patches or bundles via email """
Change 1 of 1 Show Entire File tortoisehg/​hgtk/​hgignore.py Stacked
renamed from hggtk/hgignore.py
 
12
13
14
15
16
 
 
17
18
 
19
20
21
 
12
13
14
 
 
15
16
17
 
18
19
20
21
@@ -12,10 +12,10 @@
   from mercurial import hg, ui, match, util   -from thgutil.i18n import _ -from thgutil import shlib, hglib, paths +from tortoisehg.util.i18n import _ +from tortoisehg.util import shlib, hglib, paths   -from hggtk import gtklib, gdialog +from tortoisehg.hgtk import gtklib, gdialog    class HgIgnoreDialog(gtk.Window):   'Edit a reposiory .hgignore file'
Change 1 of 1 Show Entire File tortoisehg/​hgtk/​hginit.py Stacked
renamed from hggtk/hginit.py
 
10
11
12
13
14
 
 
15
16
 
17
18
19
 
10
11
12
 
 
13
14
15
 
16
17
18
19
@@ -10,10 +10,10 @@
   from mercurial import hg, ui, util   -from thgutil.i18n import _ -from thgutil import hglib, shlib +from tortoisehg.util.i18n import _ +from tortoisehg.util import hglib, shlib   -from hggtk import dialog, gtklib +from tortoisehg.hgtk import dialog, gtklib    class InitDialog(gtk.Dialog):   """ Dialog to initialize a Mercurial repo """
Change 1 of 1 Show Entire File tortoisehg/​hgtk/​hgthread.py Stacked
renamed from hggtk/hgthread.py
 
11
12
13
14
15
 
 
16
17
 
18
19
20
 
11
12
13
 
 
14
15
16
 
17
18
19
20
@@ -11,10 +11,10 @@
   from mercurial import ui, util   -from thgutil.i18n import _ -from thgutil import hglib, thread2 +from tortoisehg.util.i18n import _ +from tortoisehg.util import hglib, thread2   -from hggtk import dialog, gdialog +from tortoisehg.hgtk import dialog, gdialog    class GtkUi(ui.ui):   '''
Change 1 of 8 Show Entire File tortoisehg/​hgtk/​hgtk.py Stacked
renamed from hggtk/hgtk.py
 
22
23
24
25
26
27
 
 
 
28
29
30
 
55
56
57
58
 
59
60
61
 
275
276
277
278
 
279
280
281
 
286
287
288
289
 
290
291
292
293
294
 
295
296
297
 
302
303
304
305
 
306
307
308
309
310
 
311
312
313
314
315
 
316
317
318
319
320
321
 
322
323
324
325
326
327
328
 
329
330
331
332
 
333
334
335
336
337
 
338
339
340
341
342
 
343
344
345
346
347
 
348
349
350
351
352
 
353
354
355
356
357
 
358
359
360
361
362
 
363
364
365
366
367
 
368
369
370
371
372
 
373
374
375
376
377
 
378
379
380
381
382
 
383
384
385
386
387
 
388
389
390
 
392
393
394
395
 
396
397
398
399
400
 
401
402
403
 
407
408
409
410
 
411
412
413
414
415
 
416
417
418
 
614
615
616
617
 
618
619
620
 
22
23
24
 
 
 
25
26
27
28
29
30
 
55
56
57
 
58
59
60
61
 
275
276
277
 
278
279
280
281
 
286
287
288
 
289
290
291
292
293
 
294
295
296
297
 
302
303
304
 
305
306
307
308
309
 
310
311
312
313
314
 
315
316
317
318
319
320
 
321
322
323
324
325
326
327
 
328
329
330
331
 
332
333
334
335
336
 
337
338
339
340
341
 
342
343
344
345
346
 
347
348
349
350
351
 
352
353
354
355
356
 
357
358
359
360
361
 
362
363
364
365
366
 
367
368
369
370
371
 
372
373
374
375
376
 
377
378
379
380
381
 
382
383
384
385
386
 
387
388
389
390
 
392
393
394
 
395
396
397
398
399
 
400
401
402
403
 
407
408
409
 
410
411
412
413
414
 
415
416
417
418
 
614
615
616
 
617
618
619
620
@@ -22,9 +22,9 @@
 import mercurial.ui as _ui  from mercurial import hg, util, fancyopts, cmdutil, extensions   -from thgutil.i18n import agettext as _ -from thgutil import hglib, paths, shlib -from thgutil import version as thgversion +from tortoisehg.util.i18n import agettext as _ +from tortoisehg.util import hglib, paths, shlib +from tortoisehg.util import version as thgversion    nonrepo_commands = '''userconfig clone debugcomplete init about help  version thgstatus serve''' @@ -55,7 +55,7 @@
  except KeyboardInterrupt:   print _('\nCaught keyboard interrupt, aborting.\n')   except: - from hggtk.bugreport import run + from tortoisehg.hgtk.bugreport import run   if '--debugger' in args:   pdb.post_mortem(sys.exc_info()[2])   error = traceback.format_exc() @@ -275,7 +275,7 @@
   def about(ui, *pats, **opts):   """about TortoiseHg""" - from hggtk.about import run + from tortoisehg.hgtk.about import run   gtkrun(run, ui, *pats, **opts)    def add(ui, *pats, **opts): @@ -286,12 +286,12 @@
   def thgstatus(ui, *pats, **opts):   """update TortoiseHg status cache""" - from hggtk.thgstatus import run + from tortoisehg.util.thgstatus import run   run(ui, *pats, **opts)    def clone(ui, *pats, **opts):   """clone tool""" - from hggtk.clone import run + from tortoisehg.hgtk.clone import run   gtkrun(run, ui, *pats, **opts)    def commit(ui, *pats, **opts): @@ -302,89 +302,89 @@
  if len(repo.parents()) > 1:   os.chdir(repo.root)   pats = [] - from hggtk.commit import run + from tortoisehg.hgtk.commit import run   gtkrun(run, ui, *pats, **opts)    def shelve(ui, *pats, **opts):   """shelve/unshelve tool""" - from hggtk.thgshelve import run + from tortoisehg.hgtk.thgshelve import run   gtkrun(run, ui, *pats, **opts)    def userconfig(ui, *pats, **opts):   """user configuration editor""" - from hggtk.thgconfig import run + from tortoisehg.hgtk.thgconfig import run   opts['repomode'] = False   gtkrun(run, ui, *pats, **opts)    def repoconfig(ui, *pats, **opts):   """repository configuration editor""" - from hggtk.thgconfig import run + from tortoisehg.hgtk.thgconfig import run   opts['repomode'] = True   gtkrun(run, ui, *pats, **opts)    def rename(ui, *pats, **opts):   """rename a single file or directory"""   if not pats or len(pats) > 2: - from hggtk import gdialog + from tortoisehg.hgtk import gdialog   gdialog.Prompt(_('Rename error'),   _('rename takes one or two path arguments'), None).run()   return - from hggtk.rename import run + from tortoisehg.hgtk.rename import run   gtkrun(run, ui, *pats, **opts)    def guess(ui, *pats, **opts):   """guess previous renames or copies""" - from hggtk.guess import run + from tortoisehg.hgtk.guess import run   gtkrun(run, ui, *pats, **opts)    def datamine(ui, *pats, **opts):   """repository search and annotate tool""" - from hggtk.datamine import run + from tortoisehg.hgtk.datamine import run   gtkrun(run, ui, *pats, **opts)    def hgignore(ui, *pats, **opts):   """ignore filter editor""" - from hggtk.hgignore import run + from tortoisehg.hgtk.hgignore import run   gtkrun(run, ui, *pats, **opts)    def hginit(ui, *pats, **opts):   """repository initialization tool""" - from hggtk.hginit import run + from tortoisehg.hgtk.hginit import run   gtkrun(run, ui, *pats, **opts)    def log(ui, *pats, **opts):   """changelog viewer""" - from hggtk.history import run + from tortoisehg.hgtk.history import run   gtkrun(run, ui, *pats, **opts)    def merge(ui, *pats, **opts):   """merge tool""" - from hggtk.merge import run + from tortoisehg.hgtk.merge import run   gtkrun(run, ui, *pats, **opts)    def recovery(ui, *pats, **opts):   """recover, rollback & verify""" - from hggtk.recovery import run + from tortoisehg.hgtk.recovery import run   gtkrun(run, ui, *pats, **opts)    def remove(ui, *pats, **opts):   """file status viewer in remove mode""" - from hggtk.status import run + from tortoisehg.hgtk.status import run   gtkrun(run, ui, *pats, **opts)    def revert(ui, *pats, **opts):   """file status viewer in revert mode""" - from hggtk.status import run + from tortoisehg.hgtk.status import run   gtkrun(run, ui, *pats, **opts)    def forget(ui, *pats, **opts):   """file status viewer in forget mode""" - from hggtk.status import run + from tortoisehg.hgtk.status import run   gtkrun(run, ui, *pats, **opts)    def serve(ui, *pats, **opts):   """web server""" - from hggtk.serve import run + from tortoisehg.hgtk.serve import run   if paths.find_root() == None and not opts['webdir_conf']:   raise hglib.RepoError(_("There is no Mercurial repository here"   " (.hg not found)")) @@ -392,12 +392,12 @@
   def status(ui, *pats, **opts):   """file status & diff viewer""" - from hggtk.status import run + from tortoisehg.hgtk.status import run   gtkrun(run, ui, *pats, **opts)    def synch(ui, *pats, **opts):   """repository synchronization tool""" - from hggtk.synch import run + from tortoisehg.hgtk.synch import run   cmd = opts['alias']   if cmd in ('push', 'outgoing', 'email'):   opts['pushmode'] = True @@ -407,12 +407,12 @@
   def update(ui, *pats, **opts):   """update/checkout tool""" - from hggtk.update import run + from tortoisehg.hgtk.update import run   gtkrun(run, ui, *pats, **opts)    def vdiff(ui, *pats, **opts):   """launch configured visual diff tool""" - from hggtk.visdiff import run, rawextdiff + from tortoisehg.hgtk.visdiff import run, rawextdiff   if opts.get('raw'):   rawextdiff(ui, *pats, **opts)   return @@ -614,7 +614,7 @@
   def archive(ui, *pats, **opts):   """create an unversioned archive of a repository revision""" - from hggtk.archive import run + from tortoisehg.hgtk.archive import run   gtkrun(run, ui, *pats, **opts)    globalopts = [
Change 1 of 1 Show Entire File tortoisehg/​hgtk/​histdetails.py Stacked
renamed from hggtk/histdetails.py
 
8
9
10
11
 
12
13
 
14
15
16
 
8
9
10
 
11
12
 
13
14
15
16
@@ -8,9 +8,9 @@
 import gtk  import gobject   -from thgutil.i18n import _ +from tortoisehg.util.i18n import _   -from hggtk import gtklib +from tortoisehg.hgtk import gtklib    class LogDetailsDialog(gtk.Dialog):  
Change 1 of 2 Show Changes Only tortoisehg/​hgtk/​history.py Stacked
renamed from hggtk/history.py
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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
 # history.py - Changelog dialog for TortoiseHg  #  # Copyright 2007 Brad Schick, brad at gmail . com  # Copyright 2008 Steve Borho <steve@borho.org>  #  # This software may be used and distributed according to the terms of the  # GNU General Public License version 2, incorporated herein by reference.    import os  import gtk  import gobject  import pango  import StringIO    from mercurial import ui, hg, cmdutil, commands, extensions, util   -from thgutil.i18n import _ -from thgutil import hglib, paths +from tortoisehg.util.i18n import _ +from tortoisehg.util import hglib, paths   -from hggtk.logview.treeview import TreeView as LogTreeView +from tortoisehg.hgtk.logview.treeview import TreeView as LogTreeView   -from hggtk import gdialog, gtklib, hgcmd, datamine, logfilter, gorev -from hggtk import backout, status, hgemail, tagadd, update, merge, archive -from hggtk import changeset, thgconfig, thgmq, histdetails +from tortoisehg.hgtk import gdialog, gtklib, hgcmd, datamine, logfilter, gorev +from tortoisehg.hgtk import backout, status, hgemail, tagadd, update, merge +from tortoisehg.hgtk import archive, changeset, thgconfig, thgmq, histdetails    def create_menu(label, callback):   menuitem = gtk.MenuItem(label, True)   menuitem.connect('activate', callback)   menuitem.set_border_width(1)   return menuitem    class GLog(gdialog.GDialog):   'GTK+ based dialog for displaying repository logs'   def init(self):   self.filter = 'all'   self.lastrevid = None   self.currevid = None   self.origtip = len(self.repo)   self.ready = False   self.filterbox = None   self.details_model = None   os.chdir(self.repo.root)     # Load extension support for commands which need it   extensions.loadall(self.ui)   self.exs = [ name for name, module in extensions.extensions() ]     def get_title(self):   return _('%s log') % self.get_reponame()     def get_icon(self):   return 'menulog.ico'     def get_default_setting(self):   return 'tortoisehg.authorcolor'     def parse_opts(self):   # Disable quiet to get full log info   self.ui.quiet = False     def get_tbbuttons(self):   tbar = [   self.make_toolbutton(gtk.STOCK_FIND,   _('_DataMine'),   self.datamine_clicked,   tip=_('Search Repository History')),   gtk.SeparatorToolItem(),   self.make_toolbutton(gtk.STOCK_JUMP_TO,   _('Select Revision'),   self.goto_clicked, menu=self.gorev_menu(),   tip=_('Select revision')),   gtk.SeparatorToolItem(),   self.make_toolbutton(gtk.STOCK_REFRESH,   _('Re_fresh'),   self.refresh_clicked,   tip=_('Reload revision history')),   gtk.SeparatorToolItem(),   ]   if not self.opts.get('from-synch'):   self.synctb = self.make_toolbutton(gtk.STOCK_NETWORK,   _('Synchronize'),   self.synch_clicked,   tip=_('Launch synchronize tool'))   tbar += [self.synctb, gtk.SeparatorToolItem()]   if 'mq' in self.exs:   self.mqtb = self.make_toolbutton(gtk.STOCK_DIRECTORY,   _('MQ'),   self.mq_clicked,   tip=_('Toggle MQ panel'),   toggle=True,   icon='menupatch.ico')   tbar += [self.mqtb, gtk.SeparatorToolItem()]   return tbar     def get_menu_list(self):   fnc = self.toggle_view_column   return [(_('View'), [   (_('Filter Bar'), True, self.toggle_show_filterbar, [],   self.show_filterbar),   ('----', None, None, None, None),   (_('Choose Details...'), False, self.details_clicked, [], None),   ('----', None, None, None, None),   (_('Compact Graph'), True, self.toggle_compactgraph, [],   self.compactgraph),   (_('Color by Branch'), True, self.toggle_branchcolor, [],   self.branch_color),   ])   ]     def synch_clicked(self, toolbutton, data):   def sync_closed(dialog):   self.synctb.set_sensitive(True)     def synch_callback(parents):   self.repo.invalidate()   newparents = [x.node() for x in self.repo.parents()]   if len(self.repo) != self.origtip:   if self.newbutton.get_active():   self.reload_log()   else:   self.newbutton.set_active(True)   elif not parents == newparents:   self.refresh_model()   - from hggtk import synch + from tortoisehg.hgtk import synch   parents = [x.node() for x in self.repo.parents()]   dlg = synch.SynchDialog([], False, True)   dlg.set_notify_func(synch_callback, parents)   dlg.connect('destroy', sync_closed)   dlg.show_all()   self.synctb.set_sensitive(False)     def toggle_view_column(self, button, property):   active = button.get_active()   self.graphview.set_property(property, active)     def toggle_branchcolor(self, button):   active = button.get_active()   if self.branch_color != active:   self.graphview.set_property('branch-color', active)   self.branch_color = active   self.reload_log()     def toggle_graphcol(self, button):   active = button.get_active()   if self.graphcol != active:   self.graphcol = active   self.reload_log()   # TODO: this could be tricky   #self.compactgraph_button.set_sensitive(self.graphcol)     def toggle_compactgraph(self, button):   active = button.get_active()   if self.compactgraph != active:   self.compactgraph = active   self.reload_log()     def toggle_show_filterbar(self, button):   self.show_filterbar = button.get_active()   if self.filterbox is not None:   self.filterbox.set_property('visible', self.show_filterbar)     def more_clicked(self, button, data=None):   self.graphview.next_revision_batch(self.limit)     def load_all_clicked(self, button, data=None):   self.graphview.load_all_revisions()   self.loadnextbutton.set_sensitive(False)   self.loadallbutton.set_sensitive(False)     def selection_changed(self, graphview):   'Graphview reports a new row selected'   treeview = graphview.treeview   (model, paths) = treeview.get_selection().get_selected_rows()   if not paths:   self.currevid = None   return False   self.currevid = graphview.get_revid_at_path(paths[0])   self.ancestrybutton.set_sensitive(True)   if self.currevid != self.lastrevid:   self.lastrevid = self.currevid   self.changeview.opts['rev'] = [str(self.currevid)]   self.changeview.load_details(self.currevid)   return False     def revisions_loaded(self, graphview):   'Graphview reports log generator has exited'   if not graphview.graphdata:   self.changeview._buffer.set_text('')   self.changeview._filelist.clear()   self.loadnextbutton.set_sensitive(False)   self.loadallbutton.set_sensitive(False)     def datamine_clicked(self, toolbutton, data=None):   dlg = datamine.DataMineDialog(self.ui, self.repo, self.cwd, [], {})   dlg.display()     def details_clicked(self, toolbutton, data=None):   self.show_details_dialog()     def show_details_dialog(self):     def close(dialog, response_id):   dialog.destroy()     model = gtk.ListStore(   gobject.TYPE_BOOLEAN, gobject.TYPE_STRING, gobject.TYPE_STRING)     model.append([self.graphcol, _('Graph'), 'graphcol'])   def column(col, default, text):   prop = col + '-column-visible'   vis = self.graphview.get_property(prop)   model.append([vis, text, prop])   column('rev', True, _('Revision Number'))   column('id', False, _('Changeset ID'))   column('branch', False, _('Branch Name'))   column('date', False, _('Local Date'))   column('utc', False, _('UTC Date'))   column('age', True, _('Age'))   column('tag', False, _('Tags'))     self.details_model = model     dlg = histdetails.LogDetailsDialog(model, self.apply_details)   dlg.connect('response', close)   dlg.show()     def apply_details(self):   if self.details_model:   reload = False   for show, uitext, property in self.details_model:   if property == 'graphcol':   if self.graphcol != show:   self.graphcol = show   reload = True   else:   self.graphview.set_property(property, show)   self.showcol[property] = show   if reload:   self.reload_log()     def filter_entry_activated(self, entry, combo):   'User pressed enter in the filter entry'   opts = {}   mode = combo.get_active()   text = entry.get_text()   if mode == 0: # Rev Range   try:   opts['revs'] = cmdutil.revrange(self.repo, [text])   except Exception, e:   gdialog.Prompt(_('Invalid revision range'), str(e), self).run()   return   elif mode == 1: # File Patterns   opts['pats'] = [w.strip() for w in text.split(',')]   elif mode == 2: # Keywords   opts['keyword'] = [w.strip() for w in text.split(',')]   elif mode == 3: # Date   try:   # return of matchdate not used, just sanity checking   util.matchdate(text)   opts['date'] = text   except (ValueError, util.Abort), e:   gdialog.Prompt(_('Invalid date specification'),   str(e), self).run()   return   else:   return   self.custombutton.set_active(True)   self.filter = 'custom'   self.reload_log(**opts)     def filter_selected(self, widget, type):   if not widget.get_active():   return   if type == 'branch':   self.select_branch(self.branchcombo)   else:   self.filter = type   self.reload_log()     def patch_selected(self, mqwidget, revid, patchname):   if revid < 0:   patchfile = os.path.join(self.repo.root, '.hg', 'patches', patchname)   self.currevid = self.lastrevid = None   self.changeview.load_patch_details(patchfile)   else:   self.currevid = revid   if self.currevid != self.lastrevid:   self.lastrevid = self.currevid   self.changeview.opts['rev'] = [str(self.currevid)]   self.changeview.load_details(self.currevid)     def repo_invalidated(self, mqwidget):   self.reload_log()     def prepare_display(self):   'Called at end of display() method'   self.ready = True   root = self.repo.root   os.chdir(root) # for paths relative to repo root     self.origtip = self.opts['orig-tip'] or len(self.repo)   self.graphview.set_property('branch-color', self.branch_color)     # ignore file patterns that imply repo root   if len(self.pats) == 1 and self.pats[0] in (root, root+os.sep, ''):   self.pats = []     opts = self.opts   if opts['filehist']:   self.custombutton.set_active(True)   self.filter = 'custom'   self.filtercombo.set_active(1)   self.filterentry.set_text(opts['filehist'])   opts['pats'] = [opts['filehist']]   elif self.pats:   self.custombutton.set_active(True)   self.filter = 'custom'   self.filtercombo.set_active(1)   self.filterentry.set_text(', '.join(self.pats))   opts['pats'] = self.pats   self.reload_log(**opts)     self.filterbox.set_property('visible', self.show_filterbar)   self.filterbox.set_no_show_all(True)     for col in ('rev', 'date', 'id', 'branch', 'utc', 'age', 'tag'):   self.graphview.set_property(col+'-column-visible',   self.showcol[col])     # enable MQ panel   self.enable_mqpanel()     def get_graphlimit(self, suggestion):   limit_opt = self.repo.ui.config('tortoisehg', 'graphlimit', '500')   l = 0   for limit in (suggestion, limit_opt):   try:   l = int(limit)   if l > 0:   return l   except (TypeError, ValueError):   pass   return l or 500     def save_settings(self):   settings = gdialog.GDialog.save_settings(self)   settings['glog-vpane'] = self.vpaned.get_position()   settings['glog-hpane'] = self.hpaned.get_position()   settings['branch-color'] = self.graphview.get_property('branch-color')   settings['show-filterbar'] = self.show_filterbar   settings['graphcol'] = self.graphcol   settings['compactgraph'] = self.compactgraph   for col in ('rev', 'date', 'id', 'branch', 'utc', 'age', 'tag'):   vis = self.graphview.get_property(col+'-column-visible')   settings['glog-vis-'+col] = vis   return settings     def load_settings(self, settings):   'Called at beginning of display() method'   gdialog.GDialog.load_settings(self, settings)   self.setting_vpos = -1   self.setting_hpos = -1   self.branch_color = False   self.show_filterbar = True   self.graphcol = True   self.compactgraph = False   self.showcol = {}   try:   self.setting_vpos = settings['glog-vpane']   self.setting_hpos = settings['glog-hpane']   self.branch_color = settings.get('branch-color', False)   self.show_filterbar = settings.get('show-filterbar', True)   for col in ('rev', 'date', 'id', 'branch', 'utc', 'age', 'tag'):   vis = settings.get('glog-vis-'+col, False)   self.showcol[col] = vis   self.graphcol = settings['graphcol']   self.compactgraph = settings['compactgraph']   except KeyError:   pass     def refresh_model(self):   'Refresh data in the history model, without reloading graph'   if self.graphview.model:   self.graphview.model.refresh()     # refresh MQ widget if exists   if hasattr(self, 'mqwidget'):   self.mqwidget.refresh()     def reload_log(self, **kwopts):   'Send refresh event to treeview object'   opts = {'date': None, 'no_merges':False, 'only_merges':False,   'keyword':[], 'branch':None, 'pats':[], 'filehist':None,   'revrange':[], 'revlist':[], 'noheads':False,   'branch-view':self.compactgraph, 'rev':[] }   opts.update(kwopts)     # handle strips, rebases, etc   self.origtip = min(len(self.repo), self.origtip)   opts['orig-tip'] = self.origtip     self.loadnextbutton.set_sensitive(True)   self.loadallbutton.set_sensitive(True)   self.newbutton.set_sensitive(self.origtip != len(self.repo))   self.ancestrybutton.set_sensitive(False)   pats = opts.get('pats', [])   self.changeview.pats = pats   self.lastrevid = None     def ftitle(filtername):   t = self.get_title()   if filtername is not None:   t = t + ' - ' + filtername   self.set_title(t)     if self.filter == 'branch':   branch = opts.get('branch', None)   self.graphview.refresh(self.graphcol, branch, opts)   ftitle(_('%s branch') % branch)   elif self.filter == 'custom':   ftitle(_('custom filter'))   if len(pats) == 1 and not os.path.isdir(pats[0]):   opts['filehist'] = pats[0]   self.graphview.refresh(self.graphcol, pats, opts)   else:   self.graphview.refresh(False, pats, opts)   elif self.filter == 'all':   ftitle(None)   self.graphview.refresh(self.graphcol, None, opts)   elif self.filter == 'new':   ftitle(_('new revisions'))   assert len(self.repo) > self.origtip   opts['revrange'] = [len(self.repo)-1, self.origtip]   self.graphview.refresh(self.graphcol, None, opts)   elif self.filter == 'only_merges':   ftitle(_('merges'))   opts['only_merges'] = True   self.graphview.refresh(False, [], opts)   elif self.filter == 'ancestry':   ftitle(_('revision ancestry'))   range = [self.currevid, 0]   opts['noheads'] = True   opts['revrange'] = range   self.graphview.refresh(self.graphcol, None, opts)   elif self.filter == 'tagged':   ftitle(_('tagged revisions'))   tagged = []   for t, r in self.repo.tagslist():   hr = self.repo[r].rev()   if hr not in tagged:   tagged.insert(0, hr)   opts['revlist'] = tagged   self.graphview.refresh(False, [], opts)   elif self.filter == 'parents':   ftitle(_('working parents'))   repo_parents = [x.rev() for x in self.repo.parents()]   opts['revlist'] = [str(x) for x in repo_parents]   self.graphview.refresh(False, [], opts)   elif self.filter == 'heads':   ftitle(_('heads'))   heads = [self.repo[x].rev() for x in self.repo.heads()]   opts['revlist'] = [str(x) for x in heads]   self.graphview.refresh(False, [], opts)     # refresh MQ widget if exists   if hasattr(self, 'mqwidget'):   self.mqwidget.refresh()     def tree_context_menu(self):   m = gtk.Menu()   m.append(create_menu(_('visualize change'), self.vdiff_change))   m.append(create_menu(_('di_splay change'), self.show_status))   m.append(create_menu(_('diff to local'), self.vdiff_local))   m.append(create_menu(_('_update'), self.checkout))   self.cmenu_merge = create_menu(_('_merge with'), self.domerge)   m.append(self.cmenu_merge)   m.append(create_menu(_('_copy hash'), self.copy_hash))   m.append(create_menu(_('_export patch'), self.export_patch))   m.append(create_menu(_('e_mail patch'), self.email_patch))   m.append(create_menu(_('_bundle rev:tip'), self.bundle_rev_to_tip))   m.append(create_menu(_('add/remove _tag'), self.add_tag))   self.cmenu_backout = create_menu(_('backout revision'),   self.backout_rev)   m.append(self.cmenu_backout)   m.append(create_menu(_('_revert'), self.revert))   m.append(create_menu(_('_archive'), self.archive))     # need transplant extension for transplant command   if 'transplant' in self.exs:   m.append(create_menu(_('transp_lant to local'),   self.transplant_rev))     # need mq extension for strip command   if 'mq' in self.exs:   m.append(create_menu(_('qimport'), self.qimport_rev))   m.append(create_menu(_('strip revision'), self.strip_rev))     m.show_all()   return m     def restore_original_selection(self, widget, *args):   self.tree.get_selection().set_mode(gtk.SELECTION_SINGLE)   self.tree.get_selection().select_path(self.origsel)     def tree_diff_context_menu(self):   m = gtk.Menu()   m.append(create_menu(_('_diff with selected'), self.diff_revs))   m.append(create_menu(_('visual diff with selected'),   self.vdiff_selected))   m.append(create_menu(_('email from here to selected'),   self.email_revs))   m.append(create_menu(_('bundle from here to selected'),   self.bundle_revs))   m.append(create_menu(_('export patches from here to selected'),   self.export_revs))   self.cmenu_merge2 = create_menu(_('_merge with'), self.domerge)   m.append(self.cmenu_merge2)     # need transplant extension for transplant command   if 'transplant' in self.exs:   m.append(create_menu(_('transplant revision range to local'),   self.transplant_revs))     # need rebase extension for rebase command   if 'rebase' in self.exs:   m.append(create_menu(_('rebase on top of selected'),   self.rebase_selected))     # need MQ extension for qimport command   if 'mq' in self.exs:   m.append(create_menu(_('qimport from here to selected'),   self.qimport_revs))   m.connect_after('selection-done', self.restore_original_selection)   m.show_all()   return m     def gorev_menu(self):   m = gtk.Menu()     def goto_tip(menuitem):   self.goto_rev(self.repo['tip'].node())   m.append(create_menu(_('tip'), goto_tip))     def goto_parent(menuitem):   self.goto_rev(self.repo['.'].node())   m.append(create_menu(_('parent'), goto_parent))     # TODO: last merged, qtip, qparent, qbase, tags     m.show_all()   return m     def get_body(self):   self.gorev_dialog = None   self._menu = self.tree_context_menu()   self._menu2 = self.tree_diff_context_menu()   self.stbar = gtklib.StatusBar()   self.limit = self.get_graphlimit(None)     # Allocate TreeView instance to use internally   if self.opts['limit']:   firstlimit = self.get_graphlimit(self.opts['limit'])   self.graphview = LogTreeView(self.repo, firstlimit, self.stbar)   else:   self.graphview = LogTreeView(self.repo, self.limit, self.stbar)     # Allocate ChangeSet instance to use internally   self.changeview = changeset.ChangeSet(self.ui, self.repo, self.cwd, [],   self.opts, self.stbar)   self.changeview.display(False)   self.changeview.glog_parent = self     # Add extra toolbar buttons   sep = gtk.SeparatorToolItem()   sep.set_expand(True)   sep.set_draw(False)   self.loadnextbutton = self.make_toolbutton(gtk.STOCK_GO_DOWN,   _('Load more'), self.more_clicked, tip=_('load more revisions'))   self.loadallbutton = self.make_toolbutton(gtk.STOCK_GOTO_BOTTOM,   _('Load all'), self.load_all_clicked, tip=_('load all revisions'))     tbar = self.changeview.get_tbbuttons()   tbar += [sep, self.loadnextbutton, self.loadallbutton]   for tbutton in tbar:   self.toolbar.insert(tbutton, -1)     # PyGtk 2.6 and below did not automatically register types   if gobject.pygtk_version < (2, 8, 0):   gobject.type_register(LogTreeView)     self.tree = self.graphview.treeview   self.graphview.connect('revision-selected', self.selection_changed)   self.graphview.connect('revisions-loaded', self.revisions_loaded)     self.tree.connect('popup-menu', self.tree_popup_menu)   self.tree.connect('button-press-event', self.tree_button_press)   self.tree.connect('row-activated', self.tree_row_act)     accelgroup = gtk.AccelGroup()   self.add_accel_group(accelgroup)   mod = gtklib.get_thg_modifier()   key, modifier = gtk.accelerator_parse(mod+'d')   self.tree.add_accelerator('thg-diff', accelgroup, key,   modifier, gtk.ACCEL_VISIBLE)   self.tree.connect('thg-diff', self.thgdiff)   key, modifier = gtk.accelerator_parse(mod+'p')   self.tree.add_accelerator('thg-parent', accelgroup, key,   modifier, gtk.ACCEL_VISIBLE)   self.tree.connect('thg-parent', self.thgparent)   self.connect('thg-refresh', self.thgrefresh)     self.filterbox = gtk.HBox()   filterbox = self.filterbox     all = gtk.RadioButton(None, _('all'))   all.set_active(True)   all.connect('toggled', self.filter_selected, 'all')   filterbox.pack_start(all, False)     self.newbutton = gtk.RadioButton(all, _('new'))   self.newbutton.connect('toggled', self.filter_selected, 'new')   filterbox.pack_start(self.newbutton, False)     tagged = gtk.RadioButton(all, _('tagged'))   tagged.connect('toggled', self.filter_selected, 'tagged')   filterbox.pack_start(tagged, False)     ancestry = gtk.RadioButton(all, _('ancestry'))   ancestry.connect('toggled', self.filter_selected, 'ancestry')   filterbox.pack_start(ancestry, False)   self.ancestrybutton = ancestry     parents = gtk.RadioButton(all, _('parents'))   parents.connect('toggled', self.filter_selected, 'parents')   filterbox.pack_start(parents, False)     heads = gtk.RadioButton(all, _('heads'))   heads.connect('toggled', self.filter_selected, 'heads')   filterbox.pack_start(heads, False)     merges = gtk.RadioButton(all, _('merges'))   merges.connect('toggled', self.filter_selected, 'only_merges')   filterbox.pack_start(merges, False)     branches = gtk.RadioButton(all, _('branch'))   branches.connect('toggled', self.filter_selected, 'branch')   branches.set_sensitive(False)   self.branchbutton = branches   filterbox.pack_start(branches, False)     dblist = self.repo.ui.config('tortoisehg', 'deadbranch', '')   deadbranches = [ x.strip() for x in dblist.split(',') ]   branchcombo = gtk.combo_box_new_text()   for name in self.repo.branchtags().keys():   if name not in deadbranches:   branchcombo.append_text(name)   branchcombo.connect('changed', self.select_branch)   self.lastbranchrow = None   filterbox.pack_start(branchcombo, False)   self.branchcombo = branchcombo     self.custombutton = gtk.RadioButton(all, _('custom'))   self.custombutton.set_sensitive(False)   filterbox.pack_start(self.custombutton, False)     filtercombo = gtk.combo_box_new_text()   for f in (_('Rev Range'), _('File Patterns'),   _('Keywords'), _('Date')):   filtercombo.append_text(f)   filtercombo.set_active(1)   self.filtercombo = filtercombo   filterbox.pack_start(filtercombo, False)     entry = gtk.Entry()   entry.connect('activate', self.filter_entry_activated, filtercombo)   self.filterentry = entry   filterbox.pack_start(entry, True)     midpane = gtk.VBox()   midpane.pack_start(filterbox, False, False, 0)   midpane.pack_start(self.graphview, True, True, 0)   midpane.show_all()     if 'mq' in self.exs:   # create MQWidget   self.mqwidget = thgmq.MQWidget(self.repo, accelgroup, self.tooltips)   self.mqwidget.connect('patch-selected', self.patch_selected)   self.mqwidget.connect('repo-invalidated', self.repo_invalidated)     def wrapframe(widget):   frame = gtk.Frame()   frame.set_shadow_type(gtk.SHADOW_ETCHED_IN)   frame.add(widget)   return frame   self.mqpaned = gtk.HPaned()   self.mqpaned.add1(wrapframe(self.mqwidget))   self.mqpaned.add2(wrapframe(midpane))     midpane = self.mqpaned     # Add ChangeSet instance to bottom half of vpane   self.changeview.graphview = self.graphview   self.hpaned = self.changeview.get_body()     self.vpaned = gtk.VPaned()   self.vpaned.pack1(midpane, True, False)   self.vpaned.pack2(self.hpaned)   gobject.idle_add(self.realize_settings)     vbox = gtk.VBox()   vbox.pack_start(self.vpaned, True, True)     # Append status bar   vbox.pack_start(gtk.HSeparator(), False, False)   vbox.pack_start(self.stbar, False, False)   return vbox     def realize_settings(self):   self.vpaned.set_position(self.setting_vpos)   self.hpaned.set_position(self.setting_hpos)     def thgdiff(self, treeview):   'ctrl-d handler'   self.vdiff_change(None)     def thgparent(self, treeview):   'ctrl-p handler'   parent = self.repo['.'].rev()   self.graphview.set_revision_id(parent)     def goto_clicked(self, toolbutton, data=None):   if self.gorev_dialog:   self.gorev_dialog.show()   self.gorev_dialog.present()   else:   self.show_goto_dialog()     def select_branch(self, combo):   row = combo.get_active()   if row >= 0 and row != self.lastbranchrow:   self.filter = 'branch'   self.lastbranchrow = row   self.branchbutton.set_active(True)   self.branchbutton.set_sensitive(True)   self.reload_log(branch=combo.get_model()[row][0])   else:   self.lastbranchrow = None   self.branchbutton.set_sensitive(False)     def show_goto_dialog(self):   'Launch a modeless goto revision dialog'   def goto_rev_(rev):   self.goto_rev(rev)     def response_(dialog, response_id):   dialog.hide()     def delete_event(dialog, event, data=None):   # return True to prevent the dialog from being destroyed   return True     dlg = gorev.GotoRevDialog(goto_rev_)   dlg.connect('response', response_)   dlg.connect('delete-event', delete_event)   dlg.set_modal(False)   dlg.show()     self.gorev_dialog = dlg     def goto_rev(self, revision):   rid = self.repo[revision].rev()   self.graphview.set_revision_id(rid, load=True)     def strip_rev(self, menuitem):   rev = self.currevid   res = gdialog.Confirm(_('Confirm Strip Revision(s)'), [], self,   _('Remove revision %d and all descendants?') % rev).run()   if res != gtk.RESPONSE_YES:   return   cmdline = ['hg', 'strip', str(rev)]   dlg = hgcmd.CmdDialog(cmdline)   dlg.show_all()   dlg.run()   dlg.hide()   self.repo.invalidate()   self.reload_log()   self.changeview._buffer.set_text('')   self.changeview._filelist.clear()     def backout_rev(self, menuitem):   oldlen = len(self.repo)   hash = str(self.repo[self.currevid])   parents = [x.node() for x in self.repo.parents()]     def refresh(*args):   self.repo.invalidate()   if len(self.repo) != oldlen:   self.reload_log()     dlg = backout.BackoutDialog(hash)   dlg.set_transient_for(self)   dlg.connect('destroy', refresh)   dlg.show_all()   dlg.present()   dlg.set_transient_for(None)     def revert(self, menuitem):   rev = self.currevid   res = gdialog.Confirm(_('Confirm Revert All Files'), [], self,   _('Revert all files to revision %d?\nThis will overwrite your '   'local changes') % rev).run()   if res != gtk.RESPONSE_YES:   return   cmdline = ['hg', 'revert', '--verbose', '--all', '--rev', str(rev)]   dlg = hgcmd.CmdDialog(cmdline)   dlg.show_all()   dlg.run()   dlg.hide()     def vdiff_change(self, menuitem, pats=[]):   self._do_diff(pats, {'change' : str(self.currevid)})     def vdiff_local(self, menuitem, pats=[]):   self._do_diff(pats, {'rev' : [str(self.currevid)]})     def diff_revs(self, menuitem):   rev0, rev1 = self.revrange   statopts = self.merge_opts(commands.table['^status|st'][1],   ('include', 'exclude', 'git'))   statopts['rev'] = ['%u:%u' % (rev0, rev1)]   statopts['modified'] = True   statopts['added'] = True   statopts['removed'] = True   dialog = status.GStatus(self.ui, self.repo, self.cwd, self.pats,   statopts)   dialog.display()   return True     def vdiff_selected(self, menuitem):   strrevs = [str(r) for r in self.revrange]   self._do_diff(self.pats, {'rev' : strrevs})     def email_revs(self, menuitem):   revrange = list(self.revrange)   revrange.sort()   opts = ['--rev', str(revrange[0]) + ':' + str(revrange[1])]   dlg = hgemail.EmailDialog(self.repo.root, opts)   dlg.set_transient_for(self)   dlg.show_all()   dlg.present()   dlg.set_transient_for(None)     def export_revs(self, menuitem):   result = gtklib.NativeFolderSelectDialog(title=_('Save patches to'),   initial=self.repo.root).run()   if result:   revs = list(self.revrange)   revs.sort()   rev = '%d:%d' % (revs[0], revs[1])   # In case new export args are added in the future, merge the   # hg defaults   opts= self.merge_opts(commands.table['^export'][1], ())   opts['output'] = os.path.join(result, '%b_rev%R.patch')   def dohgexport():   commands.export(self.ui,self.repo, rev, **opts)   s, o = self._hg_call_wrapper('Export', dohgexport, False)     def bundle_revs(self, menuitem):   revrange = list(self.revrange)   revrange.sort()   parent = self.repo[revrange[0]].parents()[0].rev()   # Special case for revision 0's parent.   if parent == -1: parent = 'null'     filename = "%s_rev%d_to_rev%s.hg" % (os.path.basename(self.repo.root),   revrange[0], revrange[1])   result = gtklib.NativeSaveFileDialogWrapper(Title=_('Write bundle to'),   InitialDir=self.repo.root,   FileName=filename).run()   if result:   cmdline = ['hg', 'bundle', '--base', str(parent),   '--rev', str(revrange[1]), result]   dlg = hgcmd.CmdDialog(cmdline)   dlg.show_all()   dlg.run()   dlg.hide()     def qimport_rev(self, menuitem):   """QImport selected revision."""   rev = str(self.currevid)   self.qimport_revs(menuitem, rev)     def qimport_revs(self, menuitem, rev=None):   """QImport revision range."""   if rev == None:   revs = list(self.revrange)   revs.sort()   rev = '%s:%s' % (str(revs[0]), str(revs[1]))   cmdline = ['hg', 'qimport', '--rev', rev]   dialog = hgcmd.CmdDialog(cmdline)   dialog.show_all()   dialog.run()   dialog.hide()   self.repo.invalidate()   self.reload_log()   self.changeview._buffer.set_text('')   self.changeview._filelist.clear()   self.enable_mqpanel()     def rebase_selected(self, menuitem):   """Rebase revision on top of selection (1st on top of 2nd)."""   revs = self.revrange   res = gdialog.Confirm(_('Confirm Rebase Revision'), [], self,   _('Rebase revision %d on top of %d?') % (revs[0], revs[1])).run()   if res != gtk.RESPONSE_YES:   return   cmdline = ['hg', 'rebase', '--source', str(revs[0]),   '--dest', str(revs[1])]   dialog = hgcmd.CmdDialog(cmdline)   dialog.show_all()   dialog.run()   dialog.hide()   self.repo.invalidate()   self.reload_log()   self.changeview._buffer.set_text('')   self.changeview._filelist.clear()     def transplant_revs(self, menuitem):   """Transplant revision range on top of current revision."""   revs = list(self.revrange)   revs.sort()   cmdline = ['hg', 'transplant', '%d:%d' % (revs[0], revs[1])]   dialog = hgcmd.CmdDialog(cmdline)   dialog.show_all()   dialog.run()   dialog.hide()   self.repo.invalidate()   self.reload_log()   self.changeview._buffer.set_text('')   self.changeview._filelist.clear()     def add_tag(self, menuitem):   # save tag info for detecting new tags added   oldtags = self.repo.tagslist()   oldlen = len(self.repo)   rev = self.currevid     def refresh(*args):   self.repo.invalidate()   if len(self.repo) != oldlen:   self.reload_log()   else:   newtags = self.repo.tagslist()   if newtags != oldtags:   self.refresh_model()     dialog = tagadd.TagAddDialog(self.repo, rev=str(rev))   dialog.set_transient_for(self)   dialog.connect('destroy', refresh)   dialog.show_all()   dialog.present()   dialog.set_transient_for(None)     def show_status(self, menuitem):   rev = self.currevid   statopts = self.merge_opts(commands.table['^status|st'][1],   ('include', 'exclude', 'git'))   if self.changeview.parent_toggle.get_active():   parent = self.repo[rev].parents()[1].rev()   else:   parent = self.repo[rev].parents()[0].rev()   statopts['rev'] = [str(parent), str(rev)]   statopts['modified'] = True   statopts['added'] = True   statopts['removed'] = True   dialog = status.GStatus(self.ui, self.repo, self.cwd, self.pats,   statopts)   dialog.display()     def copy_hash(self, menuitem):   hash = self.repo[self.currevid].hex()   sel = (os.name == 'nt') and 'CLIPBOARD' or 'PRIMARY'   clipboard = gtk.Clipboard(selection=sel)   clipboard.set_text(hash)     def export_patch(self, menuitem):   rev = self.currevid   filename = "%s_rev%s.patch" % (os.path.basename(self.repo.root), rev)   result = gtklib.NativeSaveFileDialogWrapper(Title=_('Save patch to'),   InitialDir=self.repo.root,   FileName=filename).run()   if result:   if os.path.exists(result):   res = gdialog.Confirm(_('Confirm Overwrite'), [], self,   _('The file "%s" already exists!\n\n'   'Do you want to overwrite it?') % result).run()   if res != gtk.RESPONSE_YES:   return   os.remove(result)     # In case new export args are added in the future, merge the   # hg defaults   exportOpts= self.merge_opts(commands.table['^export'][1], ())   exportOpts['output'] = result   def dohgexport():   commands.export(self.ui,self.repo,str(rev),**exportOpts)   success, outtext = self._hg_call_wrapper("Export",dohgexport,False)     def bundle_rev_to_tip(self, menuitem):   try:   rev = self.currevid   parent = self.repo[rev].parents()[0].rev()   # Special case for revision 0's parent.   if parent == -1: parent = 'null'   except (ValueError, hglib.LookupError):   return   filename = "%s_rev%d_to_tip.hg" % (os.path.basename(self.repo.root), rev)   result = gtklib.NativeSaveFileDialogWrapper(Title=_('Write bundle to'),   InitialDir=self.repo.root,   FileName=filename).run()   if result:   if os.path.exists(result):   res = gdialog.Confirm(_('Confirm Overwrite'), [], self,   _('The file "%s" already exists!\n\n'   'Do you want to overwrite it?') % result).run()   if res != gtk.RESPONSE_YES:   return   os.remove(result)     cmdline = ['hg', 'bundle', '--base', str(parent), result]   dlg = hgcmd.CmdDialog(cmdline)   dlg.show_all()   dlg.run()   dlg.hide()     def email_patch(self, menuitem):   rev = self.currevid   dlg = hgemail.EmailDialog(self.repo.root, ['--rev', str(rev)])   dlg.set_transient_for(self)   dlg.show_all()   dlg.present()   dlg.set_transient_for(None)     def checkout(self, menuitem):   rev = self.currevid   parents = [x.node() for x in self.repo.parents()]   dialog = update.UpdateDialog(rev)   dialog.set_transient_for(self)   dialog.show_all()   dialog.set_notify_func(self.checkout_completed, parents)   dialog.present()   dialog.set_transient_for(None)     def checkout_completed(self, oldparents):   self.repo.invalidate()   self.repo.dirstate.invalidate()   newparents = [x.node() for x in self.repo.parents()]   if not oldparents == newparents:   self.refresh_model()     def domerge(self, menuitem):   rev = self.currevid   parents = [x.node() for x in self.repo.parents()]   if rev == self.repo.parents()[0].rev():   rev = self.revrange[1]   dialog = merge.MergeDialog(rev)   dialog.set_transient_for(self)   dialog.show_all()   dialog.set_notify_func(self.merge_completed, parents, len(self.repo))   dialog.present()   dialog.set_transient_for(None)     def merge_completed(self, args):   self.repo.invalidate()   self.repo.dirstate.invalidate()   oldparents, repolen = args   newparents = [x.node() for x in self.repo.parents()]   if len(self.repo) != repolen:   self.reload_log()   elif not oldparents == newparents:   self.refresh_model()     def archive(self, menuitem):   rev = self.currevid   parents = [x.node() for x in self.repo.parents()]   dialog = archive.ArchiveDialog(rev)   dialog.set_transient_for(self)   dialog.show_all()   dialog.present()   dialog.set_transient_for(None)     def transplant_rev(self, menuitem):   """Transplant selection on top of current revision."""   rev = self.currevid   cmdline = ['hg', 'transplant', str(rev)]   dialog = hgcmd.CmdDialog(cmdline)   dialog.show_all()   dialog.run()   dialog.hide()   self.repo.invalidate()   self.reload_log()   self.changeview._buffer.set_text('')   self.changeview._filelist.clear()     def thgrefresh(self, window):   self.reload_log()     def refresh_clicked(self, toolbutton, data=None):   self.reload_log()   return True     def enable_mqpanel(self, enable=None):   if not hasattr(self, 'mqpaned'):   return   if enable == None:   enable = self.mqwidget.has_patch()   self.mqpaned.set_position(enable and 180 or 0)     # set the state of MQ toolbutton   if hasattr(self, 'mqtb'):   self.mqtb.handler_block_by_func(self.mq_clicked)   self.mqtb.set_active(enable)   self.mqtb.handler_unblock_by_func(self.mq_clicked)     def mq_clicked(self, toolbutton, data=None):   self.enable_mqpanel(self.mqtb.get_active())     def tree_button_press(self, tree, event):   if event.button == 3 and not (event.state & (gtk.gdk.SHIFT_MASK |   gtk.gdk.CONTROL_MASK)):   path = tree.get_path_at_pos(int(event.x), int(event.y))   if not path:   return False   crow = path[0]   (model, pathlist) = tree.get_selection().get_selected_rows()   if pathlist == []:   return False   srow = pathlist[0]   if srow == crow:   self.tree_popup_menu(tree, event.button, event.time)   else:   tree.get_selection().set_mode(gtk.SELECTION_MULTIPLE)   tree.get_selection().select_path(crow)   self.origsel = srow   rev0 = self.graphview.get_revid_at_path(srow)   rev1 = self.graphview.get_revid_at_path(crow)   self.revrange = (rev0, rev1)   self.tree_popup_menu_diff(tree, event.button, event.time)   return True   return False     def tree_popup_menu(self, treeview, button=0, time=0) :   # disable/enable menus as required   parents = [x.rev() for x in self.repo.parents()]   can_merge = self.currevid not in parents and len(parents) < 2   self.cmenu_merge.set_sensitive(can_merge)     op1, op2 = self.repo.dirstate.parents()   node = self.repo[self.currevid].node()   a = self.repo.changelog.ancestor(op1, node)   self.cmenu_backout.set_sensitive(a == node)     # display the context menu   self._menu.popup(None, None, None, button, time)   return True     def tree_popup_menu_diff(self, treeview, button=0, time=0):   # disable/enable menus as required   parents = [x.rev() for x in self.repo.parents()]   can_merge = self.currevid in parents and len(parents) < 2   self.cmenu_merge2.set_sensitive(can_merge)     # display the context menu   self._menu2.popup(None, None, None, button, time)   return True     def tree_row_act(self, tree, path, column) :   'Default action is the first entry in the context menu'   self._menu.get_children()[0].activate()   return True    def run(ui, *pats, **opts):   cmdoptions = {   'follow':False, 'follow-first':False, 'copies':False, 'keyword':[],   'limit':0, 'rev':[], 'removed':False, 'no_merges':False,   'date':None, 'only_merges':None, 'prune':[], 'git':False,   'verbose':False, 'include':[], 'exclude':[], 'from-synch':False,   'orig-tip':None, 'filehist':None, 'canonpats':[]   }   cmdoptions.update(opts)   pats = hglib.canonpaths(pats) + cmdoptions['canonpats']   return GLog(ui, None, None, pats, cmdoptions)
Show Entire File tortoisehg/​hgtk/​logview/​__init__.py Stacked
renamed from hggtk/logview/__init__.py
(No changes)
Show Entire File tortoisehg/​hgtk/​logview/​colormap.py Stacked
renamed from hggtk/logview/colormap.py
(No changes)
Show Entire File tortoisehg/​hgtk/​logview/​graphcell.py Stacked
renamed from hggtk/logview/graphcell.py
(No changes)
Show Entire File tortoisehg/​hgtk/​logview/​revgraph.py Stacked
renamed from hggtk/logview/revgraph.py
(No changes)
Change 1 of 1 Show Entire File tortoisehg/​hgtk/​logview/​treemodel.py Stacked
renamed from hggtk/logview/treemodel.py
 
17
18
19
20
21
 
 
22
23
24
 
17
18
19
 
 
20
21
22
23
24
@@ -17,8 +17,8 @@
 import gtk  import gobject  from mercurial import util, templatefilters -from thgutil import hglib -from hggtk import gtklib +from tortoisehg.util import hglib +from tortoisehg.hgtk import gtklib    # treemodel row enumerated attributes  LINES = 0 # These elements come from the changelog walker
Change 1 of 1 Show Entire File tortoisehg/​hgtk/​logview/​treeview.py Stacked
renamed from hggtk/logview/treeview.py
 
21
22
23
24
25
 
 
26
27
28
29
 
 
 
30
31
32
 
21
22
23
 
 
24
25
26
 
 
 
27
28
29
30
31
32
@@ -21,12 +21,12 @@
 import re  import time   -from thgutil.i18n import _ -from thgutil import hglib +from tortoisehg.util.i18n import _ +from tortoisehg.util import hglib   -from hggtk.logview import treemodel -from hggtk.logview.graphcell import CellRendererGraph -from hggtk.logview.revgraph import * +from tortoisehg.hgtk.logview import treemodel +from tortoisehg.hgtk.logview.graphcell import CellRendererGraph +from tortoisehg.hgtk.logview.revgraph import *      class TreeView(gtk.ScrolledWindow):
Change 1 of 1 Show Entire File tortoisehg/​hgtk/​merge.py Stacked
renamed from hggtk/merge.py
 
12
13
14
15
16
 
 
17
18
 
19
20
21
 
12
13
14
 
 
15
16
17
 
18
19
20
21
@@ -12,10 +12,10 @@
   from mercurial import hg, ui   -from thgutil.i18n import _ -from thgutil import hglib, paths +from tortoisehg.util.i18n import _ +from tortoisehg.util import hglib, paths   -from hggtk import changesetinfo, gtklib, commit, gdialog, hgcmd +from tortoisehg.hgtk import changesetinfo, gtklib, commit, gdialog, hgcmd    class MergeDialog(gtk.Window):   """ Dialog to merge revisions of a Mercurial repo """
Change 1 of 1 Show Entire File tortoisehg/​hgtk/​recovery.py Stacked
renamed from hggtk/recovery.py
 
15
16
17
18
19
 
 
20
21
 
22
23
24
 
15
16
17
 
 
18
19
20
 
21
22
23
24
@@ -15,10 +15,10 @@
   from mercurial import hg, ui   -from thgutil.i18n import _ -from thgutil import hglib, shlib, paths +from tortoisehg.util.i18n import _ +from tortoisehg.util import hglib, shlib, paths   -from hggtk import gdialog, dialog, gtklib, hgthread +from tortoisehg.hgtk import gdialog, dialog, gtklib, hgthread    class RecoveryDialog(gtk.Window):   def __init__(self):
Change 1 of 1 Show Entire File tortoisehg/​hgtk/​rename.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
@@ -0,0 +1,73 @@
+# rename.py - TortoiseHg's dialogs for handling renames +# +# Copyright 2009 Steve Borho <steve@borho.org> +# +# This software may be used and distributed according to the terms of the +# GNU General Public License version 2, incorporated herein by reference. + +import sys +import gtk +import cStringIO + +from mercurial import hg, ui, util, commands + +from tortoisehg.util.i18n import _ +from tortoisehg.util import hglib, paths + +from tortoisehg.hgtk import dialog + +def run(ui, *pats, **opts): + fname, target = '', '' + try: + fname = pats[0] + target = pats[1] + except IndexError: + pass + fname = util.normpath(fname) + if target: + target = hglib.toutf(util.normpath(target)) + else: + target = hglib.toutf(fname) + title = _('Rename ') + hglib.toutf(fname) + dlg = dialog.entry_dialog(None, title, True, target, rename_resp) + dlg.orig = fname + return dlg + +def rename_resp(dlg, response): + if response != gtk.RESPONSE_OK: + dlg.destroy() + return + try: + root = paths.find_root() + repo = hg.repository(ui.ui(), root) + except (ImportError, hglib.RepoError): + dlg.destroy() + return + + new_name = hglib.fromutf(dlg.entry.get_text()) + opts = {} + opts['force'] = False # Checkbox? Nah. + opts['after'] = False + opts['dry_run'] = False + + saved = sys.stderr + errors = cStringIO.StringIO() + toquit = False + try: + sys.stderr = errors + repo.ui.pushbuffer() + repo.ui.quiet = True + try: + commands.rename(repo.ui, repo, dlg.orig, new_name, **opts) + toquit = True + except (util.Abort, hglib.RepoError), inst: + dlg.error_dialog(None, _('rename error'), str(inst)) + toquit = False + finally: + sys.stderr = saved + textout = errors.getvalue() + repo.ui.popbuffer() + errors.close() + if len(textout) > 1: + dlg.error_dialog(None, _('rename error'), textout) + elif toquit: + dlg.destroy()
Change 1 of 1 Show Entire File tortoisehg/​hgtk/​serve.py Stacked
renamed from hggtk/serve.py
 
20
21
22
23
24
 
 
25
26
 
27
28
29
 
20
21
22
 
 
23
24
25
 
26
27
28
29
@@ -20,10 +20,10 @@
 from mercurial import hg, ui, commands, cmdutil, util  from mercurial.hgweb import server   -from thgutil.i18n import _ -from thgutil import hglib, paths +from tortoisehg.util.i18n import _ +from tortoisehg.util import hglib, paths   -from hggtk import dialog, gdialog, gtklib, thgconfig +from tortoisehg.hgtk import dialog, gdialog, gtklib, thgconfig    gservice = None  class ServeDialog(gtk.Window):
Change 1 of 2 Show Entire File tortoisehg/​hgtk/​status.py Stacked
renamed from hggtk/status.py
 
18
19
20
21
22
 
 
23
24
 
25
26
27
 
1334
1335
1336
1337
 
1338
1339
1340
 
18
19
20
 
 
21
22
23
 
24
25
26
27
 
1334
1335
1336
 
1337
1338
1339
1340
@@ -18,10 +18,10 @@
 from mercurial import cmdutil, util, commands, patch, mdiff  from mercurial import merge as merge_   -from thgutil.i18n import _ -from thgutil import hglib, shlib, paths +from tortoisehg.util.i18n import _ +from tortoisehg.util import hglib, shlib, paths, hgshelve   -from hggtk import dialog, gdialog, hgshelve, gtklib, guess, hgignore +from tortoisehg.hgtk import dialog, gdialog, gtklib, guess, hgignore    # file model row enumerations  FM_CHECKED = 0 @@ -1334,7 +1334,7 @@
  def remove(menuitem, files):   self.hg_remove(files)   def log(menuitem, files): - from hggtk import history + from tortoisehg.hgtk import history   dlg = history.run(self.ui, canonpats=files)   dlg.display()   def forget(menuitem, files):
Change 1 of 1 Show Entire File tortoisehg/​hgtk/​synch.py Stacked
renamed from hggtk/synch.py
 
17
18
19
20
21
 
 
22
23
24
 
 
25
26
27
 
17
18
19
 
 
20
21
22
 
 
23
24
25
26
27
@@ -17,11 +17,11 @@
   from mercurial import hg, ui, extensions, url   -from thgutil.i18n import _ -from thgutil import hglib, settings, paths +from tortoisehg.util.i18n import _ +from tortoisehg.util import hglib, settings, paths   -from hggtk import dialog, gtklib, hgthread, history, thgconfig, hgemail -from hggtk import thgshelve +from tortoisehg.hgtk import dialog, gtklib, hgthread, history, thgconfig +from tortoisehg.hgtk import thgshelve, hgemail    class SynchDialog(gtk.Window):   def __init__(self, repos=[], pushmode=False, fromlog=False):
Change 1 of 1 Show Entire File tortoisehg/​hgtk/​tagadd.py Stacked
renamed from hggtk/tagadd.py
 
12
13
14
15
16
 
 
17
18
 
19
20
21
 
12
13
14
 
 
15
16
17
 
18
19
20
21
@@ -12,10 +12,10 @@
   from mercurial import hg, ui, util   -from thgutil.i18n import _ -from thgutil import hglib, settings, i18n +from tortoisehg.util.i18n import _ +from tortoisehg.util import hglib, settings, i18n   -from hggtk import dialog, gtklib +from tortoisehg.hgtk import dialog, gtklib    keep = i18n.keepgettext()  
Change 1 of 2 Show Entire File tortoisehg/​hgtk/​taskbarui.py Stacked
renamed from hggtk/taskbarui.py
 
9
10
11
12
13
14
 
 
 
15
16
17
 
207
208
209
210
 
211
212
213
 
9
10
11
 
 
 
12
13
14
15
16
17
 
207
208
209
 
210
211
212
213
@@ -9,9 +9,9 @@
 import gtk  import gobject   -from thgutil.i18n import _ -from thgutil import hglib, settings, menuthg -from hggtk import gtklib +from tortoisehg.util.i18n import _ +from tortoisehg.util import hglib, settings, menuthg +from tortoisehg.hgtk import gtklib    shellcmds = '''about add clone commit datamine init log recovery  shelve synch status thgstatus userconf repoconf remove rename @@ -207,7 +207,7 @@
  return frame     def about(self, button): - from hggtk import about + from tortoisehg.hgtk import about   dlg = about.AboutDialog()   dlg.show_all()  
Change 1 of 2 Show Entire File tortoisehg/​hgtk/​thgconfig.py Stacked
renamed from hggtk/thgconfig.py
 
14
15
16
17
18
 
 
19
20
 
21
22
23
 
734
735
736
737
 
738
739
740
 
14
15
16
 
 
17
18
19
 
20
21
22
23
 
734
735
736
 
737
738
739
740
@@ -14,10 +14,10 @@
   from mercurial import hg, ui, util, url, filemerge   -from thgutil.i18n import _ -from thgutil import hglib, settings, paths +from tortoisehg.util.i18n import _ +from tortoisehg.util import hglib, settings, paths   -from hggtk import dialog, gdialog, gtklib, hgcmd +from tortoisehg.hgtk import dialog, gdialog, gtklib, hgcmd    _unspecstr = _('<unspecified>')  _unspeclocalstr = hglib.fromutf(_unspecstr) @@ -734,7 +734,7 @@
  self.pathdata.get_path(i),   self.pathtree.get_column(0))   self.refresh_path_list() - # This method may be called from hggtk.sync, so ensure page is visible + # This method may be called from hgtk.sync, so ensure page is visible   self.notebook.set_current_page(3)   self.dirty_event()  
Change 1 of 1 Show Entire File tortoisehg/​hgtk/​thgmq.py Stacked
renamed from hggtk/thgmq.py
 
10
11
12
13
14
 
 
15
16
 
17
18
19
 
10
11
12
 
 
13
14
15
 
16
17
18
19
@@ -10,10 +10,10 @@
 import gobject  import pango   -from thgutil.i18n import _ -from thgutil import hglib +from tortoisehg.util.i18n import _ +from tortoisehg.util import hglib   -from hggtk import gtklib, hgcmd +from tortoisehg.hgtk import gtklib, hgcmd    # MQ patches row enumerations  MQ_INDEX = 0
Change 1 of 1 Show Entire File tortoisehg/​hgtk/​thgshelve.py Stacked
renamed from hggtk/thgshelve.py
 
12
13
14
15
16
 
 
17
18
19
 
 
20
21
22
 
12
13
14
 
 
15
16
17
 
 
18
19
20
21
22
@@ -12,11 +12,11 @@
   from mercurial import util   -from thgutil.i18n import _ -from thgutil import hglib +from tortoisehg.util.i18n import _ +from tortoisehg.util import hglib, hgshelve   -from hggtk.status import GStatus, FM_STATUS, FM_CHECKED -from hggtk import hgshelve, gdialog, gtklib +from tortoisehg.hgtk.status import GStatus, FM_STATUS, FM_CHECKED +from tortoisehg.hgtk import gdialog, gtklib    class GShelve(GStatus):   """GTK+ based dialog for displaying repository status and shelving changes.
Change 1 of 1 Show Entire File tortoisehg/​hgtk/​update.py Stacked
renamed from hggtk/update.py
 
12
13
14
15
16
 
 
17
18
 
19
20
21
 
12
13
14
 
 
15
16
17
 
18
19
20
21
@@ -12,10 +12,10 @@
   from mercurial import hg, ui   -from thgutil.i18n import _ -from thgutil import hglib, paths +from tortoisehg.util.i18n import _ +from tortoisehg.util import hglib, paths   -from hggtk import hgcmd, gtklib +from tortoisehg.hgtk import hgcmd, gtklib    _branch_tip_ = _('= Current Branch Tip =')  
Change 1 of 1 Show Entire File tortoisehg/​hgtk/​visdiff.py Stacked
renamed from hggtk/visdiff.py
 
15
16
17
18
19
 
 
20
21
 
22
23
24
 
15
16
17
 
 
18
19
20
 
21
22
23
24
@@ -15,10 +15,10 @@
   from mercurial import hg, ui, cmdutil, util   -from thgutil.i18n import _ -from thgutil import hglib, settings, paths +from tortoisehg.util.i18n import _ +from tortoisehg.util import hglib, settings, paths   -from hggtk import gdialog, gtklib +from tortoisehg.hgtk import gdialog, gtklib    try:   import win32con
Show Entire File tortoisehg/​util/​__init__.py Stacked
renamed from thgutil/__init__.py
(No changes)
Show Entire File tortoisehg/​util/​cachethg.py Stacked
renamed from thgutil/cachethg.py
(No changes)
Show Entire File tortoisehg/​util/​debugthg.py Stacked
renamed from thgutil/debugthg.py
(No changes)
Change 1 of 1 Show Entire File tortoisehg/​util/​hglib.py Stacked
renamed from thgutil/hglib.py
 
22
23
24
25
 
26
27
28
 
22
23
24
 
25
26
27
28
@@ -22,7 +22,7 @@
 _encodingmode = encoding.encodingmode  _fallbackencoding = encoding.fallbackencoding   -from thgutil.hgversion import hgversion +from tortoisehg.util.hgversion import hgversion    def tounicode(s):   """
Change 1 of 1 Show Entire File tortoisehg/​util/​hgshelve.py Stacked
renamed from hggtk/hgshelve.py
 
21
22
23
24
25
 
 
26
27
28
 
21
22
23
 
 
24
25
26
27
28
@@ -21,8 +21,8 @@
 from mercurial import cmdutil, commands, cmdutil, hg, mdiff, patch, revlog  from mercurial import util, fancyopts   -from thgutil.i18n import _ -from thgutil import hglib +from tortoisehg.util.i18n import _ +from tortoisehg.util import hglib    lines_re = re.compile(r'@@ -(\d+),(\d+) \+(\d+),(\d+) @@\s*(.*)')  
Show Entire File tortoisehg/​util/​hgversion.py Stacked
renamed from thgutil/hgversion.py
(No changes)
Change 1 of 1 Show Entire File tortoisehg/​util/​i18n.py Stacked
renamed from thgutil/i18n.py
 
7
8
9
10
 
11
12
13
 
7
8
9
 
10
11
12
13
@@ -7,7 +7,7 @@
   import gettext, sys  from gettext import gettext as _ -from thgutil import paths, hglib +from tortoisehg.util import paths, hglib    gettext.bindtextdomain("tortoisehg", paths.get_locale_path())  gettext.textdomain("tortoisehg")
Show Entire File tortoisehg/​util/​menuthg.py Stacked
renamed from thgutil/menuthg.py
(No changes)
Change 1 of 2 Show Entire File tortoisehg/​util/​paths.py Stacked
renamed from thgutil/paths.py
 
66
67
68
69
 
70
71
72
 
99
100
101
102
 
103
104
105
 
66
67
68
 
69
70
71
72
 
99
100
101
 
102
103
104
105
@@ -66,7 +66,7 @@
  return _winreg.QueryValue(_winreg.HKEY_LOCAL_MACHINE,   r"Software\TortoiseHg")   except: - return os.path.dirname(os.path.dirname(__file__)) + return os.path.dirname(os.path.dirname(os.path.dirname(__file__)))     def netdrive_status(drive):   """ @@ -99,7 +99,7 @@
  return None     def get_prog_root(): - path = os.path.dirname(os.path.dirname(__file__)) + path = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))   return path     def netdrive_status(drive):
Show Entire File tortoisehg/​util/​settings.py Stacked
renamed from thgutil/settings.py
(No changes)
Show Entire File tortoisehg/​util/​shlib.py Stacked
renamed from thgutil/shlib.py
(No changes)
Change 1 of 1 Show Entire File tortoisehg/​util/​thgstatus.py Stacked
renamed from hggtk/thgstatus.py
 
8
9
10
11
 
12
13
14
 
8
9
10
 
11
12
13
14
@@ -8,7 +8,7 @@
 '''update TortoiseHg status cache'''    from mercurial import hg -from thgutil import paths, shlib +from tortoisehg.util import paths, shlib  import os    def cachefilepath(repo):
Show Entire File tortoisehg/​util/​thread2.py Stacked
renamed from thgutil/thread2.py
(No changes)
Change 1 of 1 Show Entire File tortoisehg/​util/​version.py Stacked
renamed from thgutil/version.py
 
5
6
7
8
 
9
10
11
 
5
6
7
 
8
9
10
11
@@ -5,7 +5,7 @@
 # This software may be used and distributed according to the terms of the  # GNU General Public License version 2, incorporated herein by reference.   -from thgutil.i18n import _ +from tortoisehg.util.i18n import _    def version():   try:
Change 1 of 1 Show Entire File win32/​reggen.py Stacked
 
18
19
20
21
 
22
23
24
25
26
 
27
28
29
 
18
19
20
 
21
22
23
24
25
 
26
27
28
29
@@ -18,12 +18,12 @@
  pfile = pfile[:-1]   path = os.path.dirname(os.path.dirname(os.path.realpath(pfile)))   thgpath = os.path.normpath(path) - testpath = os.path.join(thgpath, 'thgutil') + testpath = os.path.join(thgpath, 'tortoisehg')   if os.path.isdir(testpath) and thgpath not in sys.path:   sys.path.insert(0, thgpath)  _thg_path()   -from thgutil.menuthg import thgcmenu +from tortoisehg.util.menuthg import thgcmenu    regkeytmpl = u'[HKEY_CURRENT_USER\\Software\\TortoiseHg\\CMenu\\%s\\%s]'  regheaders = ( u'Windows Registry Editor Version 5.00',