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

merge with stable

Changeset e029f53859d8

Parents 429f63e37356

Parents c55f3b963ead

by Steve Borho

Changes to 46 files · Browse files at e029f53859d8 Showing diff from parent 429f63e37356 c55f3b963ead Diff from another changeset...

Change 1 of 1 Show Entire File MANIFEST.in Stacked
 
3
4
5
 
 
3
4
5
6
@@ -3,3 +3,4 @@
 include contrib/nautilus-thg.py  include COPYING.txt ReleaseNotes.txt  recursive-include locale *.mo +recursive-include i18n *.po
 
1
2
3
 
4
5
6
7
8
9
10
 
 
11
12
13
 
1
2
 
3
4
 
 
 
 
 
 
5
6
7
8
9
@@ -1,13 +1,9 @@
 # TortoiseHg plugin for Nautilus  # -# Copyright (C) 2007-9 Steve Borho +# Copyright 2007 Steve Borho  # -# Stolen mercilessly from nautilus-bzr, thanks guys -# Copyright (C) 2006 Jeff Bailey -# Copyright (C) 2006 Wouter van Heyst -# Copyright (C) 2006 Jelmer Vernooij -# -# Published under the GNU GPL +# This software may be used and distributed according to the terms of the +# GNU General Public License version 2, incorporated herein by reference.    import gtk  import gobject
Change 1 of 1 Show Entire File hggtk/​about.py Stacked
 
 
1
2
 
 
3
4
5
 
 
6
7
8
 
1
2
 
3
4
5
 
 
6
7
8
9
10
@@ -1,8 +1,10 @@
+# about.py - TortoiseHg About dialog  # -# TortoiseHg About dialog +# Copyright 2007 TK Soh <teekaysoh@gmail.com> +# Copyright 2007 Steve Borho <steve@borho.org>  # -# Copyright (C) 2007-9 TK Soh <teekaysoh@gmail.com> -# +# 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 sys
Change 1 of 1 Show Entire File hggtk/​backout.py Stacked
 
1
2
3
4
5
 
 
6
 
 
7
8
9
 
 
1
2
 
 
3
4
5
6
7
8
9
10
@@ -1,9 +1,10 @@
-#  # backout.py - TortoiseHg's dialog for backing out changeset  # -# Copyright (C) 2008 Steve Borho <steve@borho.org> -# Copyright (C) 2007 TK Soh <teekaysoh@gmail.com> +# Copyright 2008 TK Soh <teekaysoh@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 gtk  import gobject
 
1
2
3
4
 
5
 
 
6
7
8
 
 
1
2
 
3
4
5
6
7
8
9
@@ -1,8 +1,9 @@
-#  # bugreport.py - Bug report dialog for TortoiseHg  # -# Copyright (C) 2009 Steve Borho <steve@borho.org> +# 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 os  import gtk
 
1
2
3
4
5
 
 
6
7
8
 
 
1
2
3
4
5
6
7
8
9
@@ -1,8 +1,9 @@
-#  # changeset.py - Changeset dialog for TortoiseHg  #  # 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
Change 1 of 1 Show Entire File hggtk/​clone.py Stacked
 
 
1
2
 
 
3
4
5
 
 
6
7
8
 
1
2
 
3
4
5
 
 
6
7
8
9
10
@@ -1,8 +1,10 @@
+# clone.py - Clone dialog for TortoiseHg  # -# TortoiseHg dialog to clone a repo +# Copyright 2007 TK Soh <teekaysoh@gmail.com> +# Copyright 2007 Steve Borho <steve@borho.org>  # -# Copyright (C) 2007 TK Soh <teekaysoh@gmail.com> -# +# This software may be used and distributed according to the terms of the +# GNU General Public License version 2, incorporated herein by reference.    import gtk  import os
Change 1 of 2 Show Entire File hggtk/​commit.py Stacked
 
1
2
 
3
4
5
6
 
 
7
 
 
8
9
10
 
353
354
355
356
 
357
358
359
 
 
 
360
361
362
 
 
 
1
2
3
 
 
4
5
6
7
8
9
10
11
 
354
355
356
 
357
358
 
 
359
360
361
362
363
364
@@ -1,10 +1,11 @@
-# -# commit.py - commit dialog for TortoiseHg +# commit.py - Commit dialog for TortoiseHg  #  # Copyright 2007 Brad Schick, brad at gmail . com -# Copyright (C) 2007 TK Soh <teekaysoh@gmail.com> -# Copyright (C) 2009 Steve Borho <steve@borho.org> +# Copyright 2007 TK Soh <teekaysoh@gmail.com> +# Copyright 2007 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 errno @@ -353,10 +354,11 @@
  entry[FM_CHECKED] = True   self.update_check_count()   - # pre-fill commit message + # pre-fill commit message, if not modified   buf = self.text.get_buffer() - buf.set_text(_('merge')) - buf.set_modified(False) + if not buf.get_modified(): + buf.set_text(_('merge')) + buf.set_modified(False)       def check_patch_queue(self):
Change 1 of 1 Show Entire File hggtk/​datamine.py Stacked
 
 
1
2
 
3
4
 
 
5
6
7
 
1
2
 
3
4
 
5
6
7
8
9
@@ -1,7 +1,9 @@
+# datamine.py - Data Mining dialog for TortoiseHg  # -# Data Mining dialog for TortoiseHg and Mercurial +# Copyright 2008 Steve Borho <steve@borho.org>  # -# Copyright (C) 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 gtk  import gobject
Change 1 of 1 Show Entire File hggtk/​gdialog.py Stacked
 
1
2
3
 
4
5
6
7
 
 
8
9
10
 
1
2
3
4
5
 
 
 
6
7
8
9
10
@@ -1,10 +1,10 @@
 # gdialog.py - base dialog for gtools  #  # 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, incorporated herein by reference. -# +# 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 threading
Change 1 of 1 Show Entire File hggtk/​gtklib.py Stacked
 
 
1
2
 
 
3
4
5
 
 
6
7
8
 
1
2
 
3
4
5
 
 
6
7
8
9
10
@@ -1,8 +1,10 @@
+# gtklib.py - miscellaneous PyGTK classes and functions for TortoiseHg  # -# miscellaneous PyGTK classes and functions for TortoiseHg +# Copyright 2008 TK Soh <teekaysoh@gmail.com> +# Copyright 2009 Steve Borho <steve@borho.org>  # -# Copyright (C) 2007 TK Soh <teekaysoh@gmail.com> -# +# 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 sys
Change 1 of 1 Show Changes Only hggtk/​guess.py Stacked
1
2
3
4
 
5
 
 
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
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
 
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
-#  # guess.py - TortoiseHg's dialogs for detecting copies and renames  # -# Copyright (C) 2009 Steve Borho <steve@borho.org> +# 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 os  import sys  import gtk  import gobject  import pango  import cStringIO  import Queue    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 hggtk import gtklib    # This function and some key bits below borrowed ruthelessly from  # Peter Arrenbrecht <peter.arrenbrecht@gmail.com>  # Thanks!  def findmoves(repo, added, removed, threshold):   '''find renamed files -- yields (before, after, score) tuples'''   ctx = repo['.']   for r in removed:   rr = ctx.filectx(r).data()   for a in added:   aa = repo.wread(a)   if aa == rr:   yield r, a, 1.0   break    class DetectRenameDialog(gtk.Window):   'Detect renames after they occur'   def __init__(self):   'Initialize the Dialog'   gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)   gtklib.set_tortoise_icon(self, 'detect_rename.ico')   gtklib.set_tortoise_keys(self)     self.root = paths.find_root()   self.notify_func = None   path = toutf(os.path.basename(self.root))   self.set_title(_('Detect Copies/Renames in ') + path)   self._settings = settings.Settings('guess')   dims = self._settings.get_value('dims', (800, 600))   self.set_default_size(dims[0], dims[1])     adjustment = gtk.Adjustment(50, 0, 100, 1)   value = self._settings.get_value('percent', None)   if value: adjustment.set_value(value)   hscale = gtk.HScale(adjustment)   frame = gtk.Frame(_('Minimum Simularity Percentage'))   frame.add(hscale)   topvbox = gtk.VBox()   topvbox.pack_start(frame, False, False, 2)     unkmodel = gtk.ListStore(str, str)   unknowntree = gtk.TreeView(unkmodel)   unknowntree.get_selection().set_mode(gtk.SELECTION_MULTIPLE)   cell = gtk.CellRendererText()   cell.set_property("ellipsize", pango.ELLIPSIZE_START)   col = gtk.TreeViewColumn('File', cell, text=1)   unknowntree.append_column(col)   unknowntree.set_enable_search(True)   unknowntree.set_headers_visible(False)   scroller = gtk.ScrolledWindow()   scroller.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)   scroller.add(unknowntree)     vbox = gtk.VBox()   vbox.pack_start(scroller, True, True, 2)   fr = gtk.Button(_('Find Renames'))   fc = gtk.Button(_('Find Copies'))   hbox = gtk.HBox()   hbox.pack_start(fr, False, False, 2)   hbox.pack_start(fc, False, False, 2)   vbox.pack_start(hbox, False, False, 2)   fr.set_sensitive(False)   fc.set_sensitive(False)     unknownframe = gtk.Frame(_('Unrevisioned Files'))   unknownframe.add(vbox)     # source, dest, percent match, sensitive   cmodel = gtk.ListStore(str, str, str, str, str, bool)   ctree = gtk.TreeView(cmodel)   ctree.set_rules_hint(True)   ctree.set_reorderable(False)   ctree.set_enable_search(False)   ctree.get_selection().set_mode(gtk.SELECTION_MULTIPLE)     cell = gtk.CellRendererText()   cell.set_property('width-chars', 30)   cell.set_property('ellipsize', pango.ELLIPSIZE_START)   col = gtk.TreeViewColumn(_('Source'), cell, text=1, sensitive=5)   col.set_resizable(True)   ctree.append_column(col)     cell = gtk.CellRendererText()   cell.set_property('width-chars', 30)   cell.set_property('ellipsize', pango.ELLIPSIZE_START)   col = gtk.TreeViewColumn(_('Dest'), cell, text=3, sensitive=5)   col.set_resizable(True)   ctree.append_column(col)     cell = gtk.CellRendererText()   cell.set_property('width-chars', 5)   cell.set_property('ellipsize', pango.ELLIPSIZE_NONE)   col = gtk.TreeViewColumn('%', cell, text=4, sensitive=5)   col.set_resizable(True)   ctree.append_column(col)     scroller = gtk.ScrolledWindow()   scroller.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)   scroller.add(ctree)     stbar = gtklib.StatusBar()   vbox = gtk.VBox()   vbox.pack_start(scroller, True, True, 2)   ac = gtk.Button(_('Accept Match'))   hbox = gtk.HBox()   hbox.pack_start(ac, False, False, 2)   vbox.pack_start(hbox, False, False, 2)   ac.set_sensitive(False)     candidateframe = gtk.Frame(_('Candidate Matches'))   candidateframe.add(vbox)     hpaned = gtk.HPaned()   hpaned.pack1(unknownframe, True, True)   hpaned.pack2(candidateframe, True, True)   pos = self._settings.get_value('hpaned', None)   if pos: hpaned.set_position(pos)     topvbox.pack_start(hpaned, True, True, 2)     diffframe = gtk.Frame(_('Differences from Source to Dest'))   diffframe.set_shadow_type(gtk.SHADOW_ETCHED_IN)   scroller = gtk.ScrolledWindow()   scroller.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)   diffframe.add(scroller)     buf = gtk.TextBuffer()   buf.create_tag('removed', foreground='#900000')   buf.create_tag('added', foreground='#006400')   buf.create_tag('position', foreground='#FF8000')   buf.create_tag('header', foreground='#000090')     diffview = gtk.TextView(buf)   diffview.modify_font(pango.FontDescription('monospace'))   diffview.set_wrap_mode(gtk.WRAP_NONE)   diffview.set_editable(False)   scroller.add(diffview)     vpaned = gtk.VPaned()   vpaned.pack1(topvbox, True, False)   vpaned.pack2(diffframe)   pos = self._settings.get_value('vpaned', None)   if pos: vpaned.set_position(pos)     vbox = gtk.VBox()   vbox.pack_start(vpaned, True, True, 2)   vbox.pack_start(stbar, False, False, 2)   self.add(vbox)     args = (unknowntree, ctree, adjustment, stbar)   fc.connect('pressed', self.find_copies, *args)   fr.connect('pressed', self.find_renames, *args)   ac.connect('pressed', self.accept_match, *args)     unknowntree.get_selection().connect('changed',   self.unknown_sel_change, fr, fc)   ctree.connect('row-activated',   self.candidate_row_act, unknowntree, stbar)   ctree.get_selection().connect('changed', self.show_diff, buf, ac)   self.connect('delete-event', self.save_settings,   settings, hpaned, vpaned, adjustment)   gobject.idle_add(self.refresh, unkmodel)     def set_notify_func(self, func):   self.notify_func = func     def refresh(self, unkmodel):   q = Queue.Queue()   unkmodel.clear()   thread = thread2.Thread(target=self.unknown_thread,   args=(self.root, q))   thread.start()   gobject.timeout_add(50, self.unknown_wait, thread, q, unkmodel)     def unknown_thread(self, root, q):   try:   repo = hg.repository(ui.ui(), root)   except RepoError:   return   matcher = match.always(repo.root, repo.root)   status = repo.status(node1=repo.dirstate.parents()[0], node2=None,   match=matcher, ignored=False, clean=False, unknown=True)   (modified, added, removed, deleted, unknown, ignored, clean) = status   for u in unknown:   q.put( u )   for a in added:   if not repo.dirstate.copied(a):   q.put( a )     def unknown_wait(self, thread, q, unkmodel):   while q.qsize():   wfile = q.get(0)   unkmodel.append( [wfile, toutf(wfile)] )   return thread.isAlive()     def save_settings(self, w, event, settings, hpaned, vpaned, adjustment):   self._settings.set_value('vpaned', vpaned.get_position())   self._settings.set_value('hpaned', hpaned.get_position())   self._settings.set_value('percent', adjustment.get_value())   rect = self.get_allocation()   self._settings.set_value('dims', (rect.width, rect.height))   self._settings.write()     def find_renames(self, widget, unktree, ctree, adj, stbar):   'User pressed "find renames" button'   cmodel = ctree.get_model()   cmodel.clear()   umodel, upaths = unktree.get_selection().get_selected_rows()   if not upaths:   return   tgts = [ umodel[p][0] for p in upaths ]   q = Queue.Queue()   thread = thread2.Thread(target=self.search_thread,   args=(self.root, q, tgts, adj))   thread.start()   stbar.begin()   stbar.set_status_text(_('finding source of ') + ', '.join(tgts))   gobject.timeout_add(50, self.search_wait, thread, q, cmodel, stbar)     def search_thread(self, root, q, tgts, adj):   try:   repo = hg.repository(ui.ui(), root)   except RepoError:   return   srcs = []   audit_path = util.path_auditor(repo.root)   m = cmdutil.match(repo)   for abs in repo.walk(m):   target = repo.wjoin(abs)   good = True   try:   audit_path(abs)   except:   good = False   status = repo.dirstate[abs]   if (not good or not util.lexists(target)   or (os.path.isdir(target) and not os.path.islink(target))):   srcs.append(abs)   elif not adj and status == 'n':   # looking for copies, so any revisioned file is a   # potential source (yes, this will be expensive)   # Added and removed files are not considered as copy   # sources.   srcs.append(abs)   if adj:   simularity = adj.get_value() / 100.0;   gen = cmdutil.findrenames   else:   simularity = 1.0   gen = findmoves   for old, new, score in gen(repo, tgts, srcs, simularity):   q.put( [old, new, '%d%%' % (score*100)] )     def search_wait(self, thread, q, cmodel, stbar):   while q.qsize():   source, dest, sim = q.get(0)   cmodel.append( [source, toutf(source), dest, toutf(dest), sim, True] )   if thread.isAlive():   return True   else:   stbar.end()   return False     def find_copies(self, widget, unktree, ctree, adj, stbar):   'User pressed "find copies" button'   # call rename function with simularity = 100%   self.find_renames(widget, unktree, ctree, None, stbar)     def accept_match(self, widget, unktree, ctree, adj, stbar):   'User pressed "accept match" button'   try:   repo = hg.repository(ui.ui(), self.root)   except RepoError:   return   cmodel, upaths = ctree.get_selection().get_selected_rows()   for path in upaths:   row = cmodel[path]   src, usrc, dest, udest, percent, sensitive = row   if not sensitive:   continue   if not os.path.exists(repo.wjoin(src)):   # Mark missing rename source as removed   repo.remove([src])   repo.copy(src, dest)   shlib.shell_notify([repo.wjoin(src), repo.wjoin(dest)])   if self.notify_func:   self.notify_func()   # Mark all rows with this target file as non-sensitive   for row in cmodel:   if row[2] == dest:   row[5] = False   self.refresh(unktree.get_model())     def candidate_row_act(self, ctree, path, column, unktree, stbar):   'User activated row of candidate list'   self.accept_match(ctree, unktree, ctree, None, stbar)     def unknown_sel_change(self, selection, fr, fc):   'User selected a row in the unknown tree'   model, upaths = selection.get_selected_rows()   sensitive = upaths and True or False   fr.set_sensitive(sensitive)   fc.set_sensitive(sensitive)     def show_diff(self, selection, buf, ac):   'User selected a row in the candidate tree'   model, cpaths = selection.get_selected_rows()   sensitive = cpaths and True or False   ac.set_sensitive(sensitive)     try:   repo = hg.repository(ui.ui(), self.root)   except RepoError:   return     buf.set_text('')   bufiter = buf.get_start_iter()   for path in cpaths:   row = model[path]   src, usrc, dest, udest, percent, sensitive = row   if not sensitive:   continue   ctx = repo['.']   aa = repo.wread(dest)   rr = ctx.filectx(src).data()   opts = mdiff.defaultopts   difftext = mdiff.unidiff(rr, '', aa, '', src, dest, None, opts=opts)   if not difftext:   l = _('== %s and %s have identical contents ==\n\n') % (src, dest)   buf.insert(bufiter, l)   continue   difflines = difftext.splitlines(True)   for line in difflines:   line = toutf(line)   if line.startswith('---') or line.startswith('+++'):   buf.insert_with_tags_by_name(bufiter, line, 'header')   elif line.startswith('-'):   line = diffexpand(line)   buf.insert_with_tags_by_name(bufiter, line, 'removed')   elif line.startswith('+'):   line = diffexpand(line)   buf.insert_with_tags_by_name(bufiter, line, 'added')   elif line.startswith('@@'):   buf.insert_with_tags_by_name(bufiter, line, 'position')   else:   line = diffexpand(line)   buf.insert(bufiter, line)    def run(ui, *pats, **opts):   return DetectRenameDialog()
Change 1 of 1 Show Entire File hggtk/​hgcmd.py Stacked
 
 
1
2
 
 
3
4
5
 
 
6
7
8
 
1
2
 
3
4
5
 
 
6
7
8
9
10
@@ -1,8 +1,10 @@
+# hgcmd.py - A simple dialog to execute random command for TortoiseHg  # -# A simple dialog to execute random command for TortoiseHg +# Copyright 2007 TK Soh <teekaysoh@gmail.com> +# Copyright 2007 Steve Borho <steve@borho.org>  # -# Copyright (C) 2007 TK Soh <teekaysoh@gmail.com> -# +# This software may be used and distributed according to the terms of the +# GNU General Public License version 2, incorporated herein by reference.    import gtk  import gobject
Change 1 of 1 Show Entire File hggtk/​hgemail.py Stacked
 
1
2
3
4
5
 
 
6
 
 
7
8
9
 
 
1
2
 
 
3
4
5
6
7
8
9
10
@@ -1,9 +1,10 @@
-#  # hgemail.py - TortoiseHg's dialog for sending patches via email  # -# Copyright (C) 2007 Steve Borho <steve@borho.org> -# Copyright (C) 2007 TK Soh <teekaysoh@gmail.com> +# Copyright 2007 TK Soh <teekaysoh@gmail.com> +# Copyright 2007 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 sys
Change 1 of 1 Show Entire File hggtk/​hgignore.py Stacked
 
1
2
3
4
 
5
 
 
6
7
8
 
 
1
2
 
3
4
5
6
7
8
9
@@ -1,8 +1,9 @@
-#  # hgignore.py - TortoiseHg's dialog for editing .hgignore  # -# Copyright (C) 2008-2009 Steve Borho <steve@borho.org> +# 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
Change 1 of 1 Show Entire File hggtk/​hginit.py Stacked
 
 
1
2
 
3
4
5
 
 
6
7
8
 
1
2
 
3
4
 
 
5
6
7
8
9
@@ -1,8 +1,9 @@
+# hginit.py - TortoiseHg dialog to initialize a repo  # -# TortoiseHg dialog to initialize a repo +# Copyright 2008 Steve Borho <steve@borho.org>  # -# Copyright (C) 2008 TK Soh <teekaysoh@gmail.com> -# +# 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
Change 1 of 1 Show Entire File hggtk/​hgshelve.py Stacked
 
1
 
2
3
4
 
5
6
7
 
 
8
9
10
 
 
1
2
3
4
5
6
 
 
7
8
9
10
11
@@ -1,10 +1,11 @@
-# shelve.py +# hgshelve.py - TortoiseHg dialog to initialize a repo  #  # Copyright 2007 Bryan O'Sullivan <bos@serpentine.com>  # Copyright 2007 TK Soh <teekaysoh@gmailcom> +# Copyright 2009 Steve Borho <steve@borho.org>  # -# This software may be used and distributed according to the terms of -# the GNU General Public License, incorporated herein by reference. +# This software may be used and distributed according to the terms of the +# GNU General Public License version 2, incorporated herein by reference.    '''interactive change selection to set aside that may be restored later'''  
Change 1 of 1 Show Entire File hggtk/​hgthread.py Stacked
 
 
1
2
 
3
4
5
 
 
6
7
8
 
1
2
 
3
4
 
 
5
6
7
8
9
@@ -1,8 +1,9 @@
+# hgthread.py - Gtk UI class TortoiseHg  # -# Gtk UI class TortoiseHg +# Copyright 2009 Steve Borho <steve@borho.org>  # -# Copyright (C) 2007 TK Soh <teekaysoh@gmail.com> -# +# This software may be used and distributed according to the terms of the +# GNU General Public License version 2, incorporated herein by reference.    import gtk  import Queue
Change 1 of 1 Show Entire File hggtk/​hgtk.py Stacked
 
1
 
2
3
4
 
 
 
 
 
5
6
7
 
 
1
2
 
 
3
4
5
6
7
8
9
10
@@ -1,7 +1,10 @@
-# front-end script for TortoiseHg dialogs +# hgtk.py - front-end script for TortoiseHg dialogs  # -# Copyright (C) 2008-9 Steve Borho <steve@borho.org> -# Copyright (C) 2008 TK Soh <teekaysoh@gmail.com> +# Copyright 2008 Steve Borho <steve@borho.org> +# Copyright 2008 TK Soh <teekaysoh@gmail.com> +# +# This software may be used and distributed according to the terms of the +# GNU General Public License version 2, incorporated herein by reference.    shortlicense = '''  Copyright (C) 2009 Steve Borho <steve@borho.org>.
Change 1 of 2 Show Entire File hggtk/​history.py Stacked
 
1
2
3
4
5
 
6
 
 
7
8
9
 
841
842
843
844
845
846
847
848
 
 
 
 
1
2
3
 
4
5
6
7
8
9
10
 
842
843
844
 
 
 
 
 
845
846
@@ -1,9 +1,10 @@
-#  # history.py - Changelog dialog for TortoiseHg  #  # Copyright 2007 Brad Schick, brad at gmail . com -# Copyright (C) 2007 TK Soh <teekaysoh@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 @@ -841,8 +842,5 @@
  'date':None, 'only_merges':None, 'prune':[], 'git':False,   'verbose':False, 'include':[], 'exclude':[]   } - root = paths.find_root() - canonpats = [] - for f in pats: - canonpats.append(util.canonpath(root, os.getcwd(), f)) - return GLog(ui, None, None, canonpats, cmdoptions) + pats = hglib.canonpaths(pats) + return GLog(ui, None, None, pats, cmdoptions)
 
1
2
3
4
 
 
5
 
 
6
7
8
 
 
1
2
 
3
4
5
6
7
8
9
10
@@ -1,8 +1,10 @@
-#  # logfilter.py - TortoiseHg's dialog for defining log filter criteria  # -# Copyright (C) 2007 TK Soh <teekaysoh@gmail.com> +# Copyright 2007 TK Soh <teekaysoh@gmail.com> +# Copyright 2007 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
 
 
 
 
 
 
 
 
1
2
3
 
1
2
3
4
5
6
7
8
9
10
@@ -1,3 +1,10 @@
+# treemodel.py - changelog viewer data model +# +# 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. +  ''' Mercurial revision DAG visualization library     Implements a gtk.TreeModel which visualizes a Mercurial repository
 
 
 
 
 
 
 
 
1
2
3
 
1
2
3
4
5
6
7
8
9
10
@@ -1,3 +1,10 @@
+# treeview.py - changelog viewer implementation +# +# 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. +  ''' Mercurial revision DAG visualization library     Implements a gtk.TreeModel which visualizes a Mercurial repository
Change 1 of 1 Show Entire File hggtk/​merge.py Stacked
 
1
2
3
4
 
 
5
 
 
6
7
8
 
 
1
2
 
3
4
5
6
7
8
9
10
@@ -1,8 +1,10 @@
-#  # merge.py - TortoiseHg's dialog for merging revisions  # -# Copyright (C) 2007 TK Soh <teekaysoh@gmail.com> +# Copyright 2007 TK Soh <teekaysoh@gmail.com> +# Copyright 2007 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
Change 1 of 1 Show Entire File hggtk/​recovery.py Stacked
 
 
1
2
 
 
3
4
5
6
 
 
7
8
9
 
1
2
 
3
4
5
 
 
 
6
7
8
9
10
@@ -1,9 +1,10 @@
+# recovery.py - Repository recovery dialog for TortoiseHg  # -# Repository recovery dialog for TortoiseHg +# Copyright 2007 TK Soh <teekaysoh@gmail.com> +# Copyright 2007 Steve Borho <steve@borho.org>  # -# Copyright (C) 2007 Steve Borho <steve@borho.org> -# Copyright (C) 2007 TK Soh <teekaysoh@gmail.com> -# +# This software may be used and distributed according to the terms of the +# GNU General Public License version 2, incorporated herein by reference.    import gtk  import gobject
Change 1 of 1 Show Entire File hggtk/​rename.py Stacked
 
1
2
3
4
 
5
 
 
6
7
8
 
 
1
2
 
3
4
5
6
7
8
9
@@ -1,8 +1,9 @@
-#  # rename.py - TortoiseHg's dialogs for handling renames  # -# Copyright (C) 2009 Steve Borho <steve@borho.org> +# 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
Change 1 of 1 Show Entire File hggtk/​serve.py Stacked
 
 
1
2
 
 
3
4
5
6
 
 
7
8
9
 
1
2
 
3
4
5
 
 
 
6
7
8
9
10
@@ -1,9 +1,10 @@
+# serve.py - TortoiseHg dialog to start web server  # -# TortoiseHg dialog to start web server +# Copyright 2007 Steve Borho <steve@borho.org> +# Copyright 2007 TK Soh <teekaysoh@gmail.com>  # -# Copyright (C) 2007 Steve Borho <steve@borho.org> -# Copyright (C) 2007 TK Soh <teekaysoh@gmail.com> -# +# This software may be used and distributed according to the terms of the +# GNU General Public License version 2, incorporated herein by reference.    import gtk  import gobject
Change 1 of 1 Show Entire File hggtk/​status.py Stacked
 
1
2
3
4
5
6
 
 
7
8
 
 
9
10
11
 
 
1
2
3
 
 
4
5
6
 
7
8
9
10
11
@@ -1,11 +1,11 @@
-#  # status.py - status dialog for TortoiseHg  #  # Copyright 2007 Brad Schick, brad at gmail . com -# Copyright (C) 2007-8 TK Soh <teekaysoh@gmail.com> -# Copyright (C) 2008-9 Steve Borho <steve@borho.org> +# Copyright 2007 TK Soh <teekaysoh@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 cStringIO
Change 1 of 1 Show Entire File hggtk/​synch.py Stacked
 
 
1
2
 
 
3
4
5
6
 
 
7
8
9
 
1
2
 
3
4
5
 
 
 
6
7
8
9
10
@@ -1,9 +1,10 @@
+# synch.py - Repository synchronization dialog for TortoiseHg  # -# Repository synchronization dialog for TortoiseHg +# Copyright 2007 TK Soh <teekaysoh@gmail.com> +# Copyright 2007 Steve Borho <steve@borho.org>  # -# Copyright (C) 2007 Steve Borho <steve@borho.org> -# Copyright (C) 2007 TK Soh <teekaysoh@gmail.com> -# +# This software may be used and distributed according to the terms of the +# GNU General Public License version 2, incorporated herein by reference.    import gtk  import gobject
Change 1 of 1 Show Entire File hggtk/​tagadd.py Stacked
 
 
1
2
 
 
3
4
5
 
 
6
7
8
 
1
2
 
3
4
5
 
 
6
7
8
9
10
@@ -1,8 +1,10 @@
+# tagadd.py - TortoiseHg dialog to add tag  # -# TortoiseHg dialog to add tag +# Copyright 2007 TK Soh <teekaysoh@gmail.com> +# Copyright 2007 Steve Borho <steve@borho.org>  # -# Copyright (C) 2007 TK Soh <teekaysoh@gmail.com> -# +# 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
 
1
2
3
4
 
5
 
 
6
7
8
 
 
1
2
 
3
4
5
6
7
8
9
@@ -1,8 +1,9 @@
-#  # taskbarui.py - User interface for the TortoiseHg taskbar app  # -# Copyright (C) 2009 Steve Borho <steve@borho.org> +# 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 os  import gtk
 
1
2
 
3
4
5
 
6
 
 
7
8
9
 
 
 
1
2
 
 
3
4
5
6
7
8
9
@@ -1,9 +1,9 @@
-#_ -# Configuration dialog for TortoiseHg and Mercurial +# thgconfig.py - Configuration dialog for TortoiseHg and Mercurial  # -# Copyright (C) 2008-9 Steve Borho <steve@borho.org> -# Copyright (C) 2007 TK Soh <teekaysoh@gmail.com> +# Copyright 2007 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 gtk  import os
 
1
2
3
4
5
6
 
 
7
 
 
8
9
10
 
 
1
2
3
 
 
4
5
6
7
8
9
10
11
@@ -1,10 +1,11 @@
-#  # thgshelve.py - commit dialog for TortoiseHg  #  # Copyright 2007 Brad Schick, brad at gmail . com -# Copyright (C) 2007 TK Soh <teekaysoh@gmail.com> -# Copyright (C) 2009 Steve Borho <steve@borho.org> +# Copyright 2007 TK Soh <teekaysoh@gmail.com> +# Copyright 2007 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
 
1
2
3
4
 
5
 
 
6
7
8
 
 
1
2
 
3
4
5
6
7
8
9
@@ -1,8 +1,9 @@
-#  # thgstatus.py - update TortoiseHg status cache  # -# Copyright (C) 2009 Adrian Buehlmann +# Copyright 2009 Adrian Buehlmann  # +# This software may be used and distributed according to the terms of the +# GNU General Public License version 2, incorporated herein by reference.    '''update TortoiseHg status cache'''  
Change 1 of 1 Show Entire File hggtk/​update.py Stacked
 
1
2
3
4
 
 
5
 
 
6
7
8
 
 
1
2
 
3
4
5
6
7
8
9
10
@@ -1,8 +1,10 @@
-#  # update.py - TortoiseHg's dialog for updating repo  # -# Copyright (C) 2007 TK Soh <teekaysoh@gmail.com> +# Copyright 2007 TK Soh <teekaysoh@gmail.com> +# Copyright 2007 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
Change 1 of 2 Show Entire File hggtk/​visdiff.py Stacked
 
1
2
3
 
4
5
6
7
8
 
 
9
10
11
 
276
277
278
279
280
281
282
283
 
 
1
2
 
3
4
 
 
 
 
5
6
7
8
9
 
274
275
276
 
 
 
 
 
277
@@ -1,11 +1,9 @@
 # visdiff.py - launch external visual diff tools  # -# Copyright 2009 Steve Borho +# Copyright 2009 Steve Borho <steve@borho.org>  # -# Based on extdiff extension for Mercurial -# -# This software may be used and distributed according to the terms -# of the GNU General Public License, incorporated herein by reference. +# This software may be used and distributed according to the terms of the +# GNU General Public License version 2, incorporated herein by reference.    import gtk  import gobject @@ -276,8 +274,4 @@
  return tools    def run(ui, *pats, **opts): - root = paths.find_root() - canonpats = [] - for f in pats: - canonpats.append(util.canonpath(root, os.getcwd(), f)) - return FileSelectionDialog(canonpats, opts) + return FileSelectionDialog(hglib.canonpaths(pats), opts)
 
 
 
 
 
 
 
 
1
2
3
 
1
2
3
4
5
6
7
8
9
10
@@ -1,3 +1,10 @@
+# cachethg.py - overlay/status cache +# +# 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 sys  
 
 
 
 
 
 
 
 
1
2
3
 
1
2
3
4
5
6
7
8
9
10
@@ -1,3 +1,10 @@
+# debugthg.py - debugging library for TortoiseHg shell extensions +# +# 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. +  debugging = ''  try:   import _winreg
Change 1 of 2 Show Entire File thgutil/​hglib.py Stacked
 
1
2
3
4
5
6
7
 
 
 
 
 
 
8
9
10
 
113
114
115
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
117
118
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
 
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
@@ -1,10 +1,9 @@
-""" -hglib.py - Copyright (C) 2007 Steve Borho <steve@borho.org> - -This software may be used and distributed according to the terms -of the GNU General Public License, incorporated herein by reference. -""" +# hglib.py - Mercurial API wrappers for TortoiseHg +# +# Copyright 2007 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 sys @@ -113,6 +112,25 @@
  if 'mq' in repo.__dict__: #do not create if it does not exist   repo.mq.invalidate()   +def canonpaths(list): + 'Get canonical paths (relative to root) for list of files' + canonpats = [] + cwd = os.getcwd() + root = paths.find_root(cwd) + for f in list: + try: + canonpats.append(util.canonpath(root, cwd, f)) + except util.Abort: + # Attempt to resolve case folding conflicts. + fu = f.upper() + cwdu = cwd.upper() + if fu.startswith(cwdu): + canonpats.append(util.canonpath(root, cwd, f[len(cwd+os.sep):])) + else: + # May already be canonical + canonpats.append(f) + return canonpats +  def hgcmd_toq(path, q, *args):   '''   Run an hg command in a background thread, pipe all output to a Queue
Change 1 of 1 Show Entire File thgutil/​i18n.py Stacked
 
1
2
3
4
5
6
7
 
 
 
 
 
 
8
9
10
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
@@ -1,10 +1,9 @@
-""" -i18n.py - Copyright (C) 2009 Steve Borho <steve@borho.org> - -This software may be used and distributed according to the terms -of the GNU General Public License, incorporated herein by reference. -""" +# i18n.py - TortoiseHg internationalization code +# +# 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 gettext, sys  from gettext import gettext as _
 
1
2
3
4
 
 
 
 
 
 
5
6
7
 
 
 
 
 
1
2
3
4
5
6
7
8
9
@@ -1,7 +1,9 @@
-# Published under the GNU GPL, v2 or later. -# Copyright (C) 2007 Jelmer Vernooij <jelmer@samba.org> -# Copyright (C) 2007 Henry Ludemann <misc@hl.id.au> -# Copyright (C) 2007 TK Soh <teekaysoh@gmail.com> +# menuthg.py - TortoiseHg shell extension menu +# +# 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 os  
Change 1 of 1 Show Entire File thgutil/​paths.py Stacked
 
1
2
3
4
5
6
7
 
 
 
 
 
 
8
9
10
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
@@ -1,10 +1,9 @@
-""" -paths.py - Copyright (C) 2009 Steve Borho <steve@borho.org> - -This software may be used and distributed according to the terms -of the GNU General Public License, incorporated herein by reference. -""" +# paths.py - TortoiseHg path utilities +# +# 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.    try:   from config import icon_path, bin_path, license_path, locale_path
 
1
2
3
4
5
6
7
 
 
 
 
 
 
 
8
9
10
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
@@ -1,10 +1,10 @@
-""" -settings.py - TortoiseHg dialog settings library - Copyright (C) 2007 TK Soh <teekaysoh@gmail.com> - -This software may be used and distributed according to the terms -of the GNU General Public License, incorporated herein by reference. -""" +# settings.py - TortoiseHg dialog settings library +# +# Copyright 2007 TK Soh <teekaysoh@gmail.com> +# 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 os  import cPickle
Change 1 of 1 Show Entire File thgutil/​shlib.py Stacked
 
1
2
3
4
5
6
7
 
 
 
 
 
 
 
8
9
10
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
@@ -1,10 +1,10 @@
-""" -shlib.py - TortoiseHg shell utilities - Copyright (C) 2007 TK Soh <teekaysoh@gmail.com> - -This software may be used and distributed according to the terms -of the GNU General Public License, incorporated herein by reference. -""" +# shlib.py - TortoiseHg shell utilities +# +# Copyright 2007 TK Soh <teekaysoh@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 sys
 
1
2
3
 
 
 
4
5
6
 
1
2
3
4
5
6
7
8
9
@@ -1,6 +1,9 @@
 # Interuptible threads  #  # http://sebulba.wikispaces.com/recipe+thread2 +# +# This software may be used and distributed according to the terms of the +# GNU General Public License version 2, incorporated herein by reference.    import threading  import inspect
 
1
2
3
4
5
6
7
 
 
 
 
 
 
8
9
10
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
@@ -1,10 +1,9 @@
-""" -version.py - TortoiseHg version - Copyright (C) 2009 Steve Borho <steve@borho.org> - -This software may be used and distributed according to the terms -of the GNU General Public License, incorporated herein by reference. -""" +# version.py - TortoiseHg version +# +# 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.    from thgutil.i18n import _