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 Changes Only tortoisehg/​hgtk/​commit.py Stacked
renamed from hggtk/commit.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
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
 # commit.py - Commit dialog for TortoiseHg  #  # Copyright 2007 Brad Schick, brad at 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 errno  import gtk  import gobject  import pango  import tempfile  import cStringIO  import time    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):   gtk.Dialog.__init__(self, parent=None, flags=gtk.DIALOG_MODAL,   buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,   gtk.STOCK_OK, gtk.RESPONSE_OK))   gtklib.set_tortoise_keys(self)   self.set_title(_('Branch Operations'))   self.newbranch = None   self.closebranch = False     if mergebranches:   lbl = gtk.Label(_('Select branch of merge commit'))   branchcombo = gtk.combo_box_new_text()   for name in mergebranches:   branchcombo.append_text(name)   branchcombo.set_active(0)   self.vbox.pack_start(lbl, True, True, 2)   self.vbox.pack_start(branchcombo, True, True, 2)   self.connect('response', self.merge_response, branchcombo)   self.show_all()   return     self.connect('response', self.response)   lbl = gtk.Label(_('Changes take effect on next commit'))   nochanges = gtk.RadioButton(None, _('No branch changes'))   self.newbranchradio = gtk.RadioButton(nochanges,   _('Open a new named branch'))   self.closebranchradio = gtk.RadioButton(nochanges,   _('Close current named branch'))   self.branchentry = gtk.Entry()   self.branchentry.connect('activate', self.activated)     hbox = gtk.HBox()   hbox.pack_start(self.newbranchradio, False, False, 2)   hbox.pack_start(self.branchentry, True, True, 2)   self.vbox.pack_start(hbox, True, True, 2)   hbox = gtk.HBox()   hbox.pack_start(self.closebranchradio, True, True, 2)   self.vbox.pack_start(hbox, True, True, 2)   hbox = gtk.HBox()   hbox.pack_start(nochanges, True, True, 2)   self.vbox.pack_start(hbox, True, True, 2)   self.vbox.pack_start(lbl, True, True, 10)   self.newbranchradio.connect('toggled', self.nbtoggle)     self.newbranchradio.set_active(True)   if branch:   self.newbranch = branch   self.branchentry.set_text(branch)   self.newbranchradio.set_active(True)   elif close:   self.closebranch = close   self.closebranchradio.set_active(True)   else:   nochanges.set_active(True)   self.show_all()     def nbtoggle(self, radio):   self.branchentry.set_sensitive(radio.get_active())   if radio.get_active():   self.branchentry.grab_focus()     def activated(self, entry):   self.response(self, response_id=gtk.RESPONSE_OK)     def response(self, widget, response_id):   if response_id == gtk.RESPONSE_OK:   if self.newbranchradio.get_active():   self.newbranch = self.branchentry.get_text()   elif self.closebranchradio.get_active():   self.closebranch = True   else:   self.newbranch = None   self.closebranch = False   self.destroy()     def merge_response(self, widget, response_id, combo):   self.closebranch = False   if response_id == gtk.RESPONSE_OK:   row = combo.get_active()   if row == 1:   self.newbranch = combo.get_model()[row][0]   self.destroy()      class GCommit(GStatus):   """GTK+ based dialog for displaying repository status and committing   changes. Also provides related operations like add, delete, remove,   revert, refresh, ignore, diff, and edit.   """     ### Overrides of base class methods ###     def init(self):   GStatus.init(self)   self.mode = 'commit'   self.nextbranch = None   self.closebranch = False   self.last_commit_id = None   self.qnew = False   self.notify_func = None     def set_notify_func(self, func, args):   self.notify_func = func   self.notify_args = args     def parse_opts(self):   GStatus.parse_opts(self)     def get_title(self):   root = self.get_reponame()   user = self.opts.get('user')   if user: user = 'as ' + user   date = self.opts.get('date')   pats = ' '.join(self.pats)   if self.qnew:   return root + ' qnew'   elif self.mqmode:   patch = self.repo.mq.lookup('qtip')   return root + ' qrefresh ' + patch   return ' '.join([root, 'commit', pats or '', user or '', date or ''])     def get_icon(self):   return 'menucommit.ico'     def get_default_setting(self):   return 'ui.username'     def auto_check(self):   if self.test_opt('check'):   for entry in self.filemodel:   if entry[FM_STATUS] in 'MAR':   entry[FM_CHECKED] = True   self.update_check_count()   self.opts['check'] = False       def get_menu_list(self):   return [(_('View'),   [(_('Advanced'), True, self.toggleview, ['advanced'], self.showadvanced),   (_('Parents'), True, self.toggleview, ['parents'], self.showparents)])]     def save_settings(self):   settings = GStatus.save_settings(self)   settings['commit-vpane'] = self.vpaned.get_position()   settings['showparents'] = self.showparents   settings['showadvanced'] = self.showadvanced   return settings       def load_settings(self, settings):   self.connect('delete-event', self.delete)   GStatus.load_settings(self, settings)   self.setting_vpos = -1   self.showparents = True   self.showadvanced = False   try:   self.setting_vpos = settings['commit-vpane']   self.showparents = settings['showparents']   self.showadvanced = settings['showadvanced']   except KeyError:   pass       def get_tbbuttons(self):   # insert to head of toolbar   tbbuttons = GStatus.get_tbbuttons(self)   tbbuttons.insert(0, gtk.SeparatorToolItem())   self.undo_button = self.make_toolbutton(gtk.STOCK_UNDO, _('_Undo'),   self.undo_clicked, tip=_('undo recent commit'))   self.commit_button = self.make_toolbutton(gtk.STOCK_OK, _('_Commit'),   self.commit_clicked, tip=_('commit'))   tbbuttons.insert(0, self.undo_button)   tbbuttons.insert(0, self.commit_button)   return tbbuttons     def should_live(self, widget=None, event=None):   # If there are more than a few character typed into the commit   # message, ask if the exit should continue.   live = False   buf = self.text.get_buffer()   if buf.get_char_count() > 10 and buf.get_modified():   # response: 0=Yes, 1=No, 2=Cancel   response = gdialog.CustomPrompt(_('Confirm Exit'),   _('Save commit message at exit?'), self,   (_('&Yes'), _('&No'), _('&Cancel')), 2, 2).run()   if response == 0:   begin, end = buf.get_bounds()   self.update_recent_messages(buf.get_text(begin, end))   buf.set_modified(False)   elif response == 2:   live = True   if not live:   self._destroying(widget)   return live       def refresh_complete(self):   self.check_merge()   self.check_patch_queue()   self.check_undo()   self.refresh_branchop()   self.update_parent_labels()   if not self.committer_cbbox.get_active_text():   user = self.opts['user'] or self.repo.ui.config('ui', 'username')   if user:   update_recent_committers(hglib.toutf(user))   if not self.autoinc_entry.get_text():   autoinc = self.repo.ui.config('tortoisehg', 'autoinc', '')   self.autoinc_entry.set_text(hglib.toutf(autoinc))   if self.qnew:   self.qnew_name.grab_focus() # set focus back   self.qnew_name.set_position(-1)     def get_body(self):   status_body = GStatus.get_body(self)     vbox = gtk.VBox()   mbox = gtk.HBox()     self.connect('thg-accept', self.thgaccept)   self.branchbutton = gtk.Button()   self.branchbutton.connect('clicked', self.branch_clicked)   mbox.pack_start(self.branchbutton, False, False, 2)   if self.merging:   branches = [p.branch() for p in self.repo.parents()]   if branches[0] == branches[1]:   self.branchbutton.set_sensitive(False)     if hasattr(self.repo, 'mq'):   label = gtk.Label('QNew: ')   mbox.pack_start(label, False, False, 2)   self.qnew_name = gtk.Entry()   self.qnew_name.set_width_chars(20)   self.qnew_name.connect('changed', self.qnew_changed)   mbox.pack_start(self.qnew_name, False, False, 2)   else:   self.qnew_name = None     liststore = gtk.ListStore(str, str)   self.msg_cbbox = gtk.ComboBox(liststore)   cell = gtk.CellRendererText()   self.msg_cbbox.pack_start(cell, True)   self.msg_cbbox.add_attribute(cell, 'text', 0)   liststore.append([_('Recent commit messages...'), ''])   self.msg_cbbox.set_active(0)   self.popupid = self.msg_cbbox.connect('notify::popup-shown',   self.first_msg_popdown)   self.msg_cbbox.connect('changed', self.changed_cb)   mbox.pack_start(self.msg_cbbox)   vbox.pack_start(mbox, False, False)   self._mru_messages = self.settings.mrul('recent_messages')     frame = gtk.Frame()   frame.set_shadow_type(gtk.SHADOW_ETCHED_IN)   scroller = gtk.ScrolledWindow()   scroller.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)   frame.add(scroller)   vbox.pack_start(frame)     self.text = gtk.TextView()   self.text.connect('populate-popup', self.msg_add_to_popup)   self.text.modify_font(pango.FontDescription(self.fontcomment))   scroller.add(self.text)   gtklib.addspellcheck(self.text, self.repo.ui)     self.advanced_frame = gtk.Frame(_('Advanced'))   adv_hbox = gtk.HBox(spacing=2)   adv_hbox.pack_start(gtk.Label(_('Committer:')), False, False, 2)     liststore = gtk.ListStore(str)   self.committer_cbbox = gtk.ComboBoxEntry(liststore)   cell = gtk.CellRendererText()   self.committer_cbbox.pack_start(cell, True)   adv_hbox.pack_start(self.committer_cbbox, True, True, 2)   self._mru_committers = self.settings.mrul('recent_committers')   self.update_recent_committers()   committer = self.repo.ui.config('ui', 'username')   if committer:   self.update_recent_committers(committer)   self.committer_cbbox.set_active(0)     adv_hbox.pack_start(gtk.Label(_('Auto-includes:')), False, False, 2)   self.autoinc_entry = gtk.Entry()   adv_hbox.pack_start(self.autoinc_entry, False, False, 2)   self.autopush = gtk.CheckButton(_('Push after commit'))   pushafterci = self.repo.ui.configbool('tortoisehg', 'pushafterci')   self.autopush.set_active(pushafterci)   adv_hbox.pack_start(self.autopush, False, False, 2)   self.advanced_frame.add(adv_hbox)   vbox.pack_start(self.advanced_frame, False, False, 2)     vbox2 = gtk.VBox()   vbox2.pack_start(status_body)     self.parents_frame = gtk.Frame(_('Parent'))   parents_vbox = gtk.VBox(spacing=2)   self.parents_frame.add(parents_vbox)   def plabel():   w = gtk.Label()   w.set_selectable(True)   hb = gtk.HBox()   hb.pack_start(w, False, False, 4)   parents_vbox.pack_start(hb, False, False)   return w   self.parent1_label = plabel()   self.parent2_label = plabel()   vbox2.pack_start(self.parents_frame, False, False)     self.vpaned = gtk.VPaned()   self.vpaned.pack1(vbox, shrink=False)   self.vpaned.pack2(vbox2, shrink=False)   gobject.idle_add(self.realize_settings)   return self.vpaned     ### End of overridable methods ###       def toggleview(self, button, type):   show = button.get_active()   statename = 'show' + type   if getattr(self, statename) != show:   frame = getattr(self, type + '_frame')   if show:   frame.show()   else:   frame.hide()   setattr(self, statename, show)     def update_recent_committers(self, name=None):   if name is not None:   self._mru_committers.add(name)   self._mru_committers.compact()   self.settings.write()   liststore = self.committer_cbbox.get_model()   liststore.clear()   for name in self._mru_committers:   liststore.append([name])     def changed_cb(self, combobox):   model = combobox.get_model()   index = combobox.get_active()   if index >= 0:   buf = self.text.get_buffer()   if buf.get_char_count() and buf.get_modified():   response = gdialog.Confirm(_('Confirm Discard Message'),   [], self, _('Discard current commit message?')).run()   if response != gtk.RESPONSE_YES:   combobox.set_active(-1)   return   buf.set_text(model[index][1])   buf.set_modified(False)     def first_msg_popdown(self, combo, shown):   combo.disconnect(self.popupid)   self.popupid = None   self.update_recent_messages()     def update_recent_messages(self, msg=None):   if msg is not None:   self._mru_messages.add(msg)   self.settings.write()   if self.popupid is not None: return   liststore = self.msg_cbbox.get_model()   liststore.clear()   for msg in self._mru_messages:   sumline = hglib.toutf(hglib.tounicode(msg).splitlines()[0])   liststore.append([sumline, msg])     def branch_clicked(self, button):   if self.merging:   mb = [p.branch() for p in self.repo.parents()]   else:   mb = None   dialog = BranchOperationDialog(self.nextbranch, self.closebranch, mb)   dialog.run()   self.nextbranch = None   self.closebranch = False   if dialog.newbranch:   self.nextbranch = dialog.newbranch   elif dialog.closebranch:   self.closebranch = True   self.refresh_branchop()     def update_parent_labels(self):     def setlabel(label, ctx, ishead):   revision = str(ctx.rev())   hash = str(ctx)   summary = gtklib.markup_escape_text(hglib.toutf(   ctx.description().split('\n')[0]))   face = 'monospace'   size = '9000'     format = '<span face="%s" size="%s">%s (%s) </span>'   t = format % (face, size, revision, hash)     if not ishead and not self.mqmode:   format = '<b>[%s]</b> '   t += format % _('not at head revision')     branch = ctx.branch()   if branch != 'default':   format = '<span color="%s" background="%s"> %s </span> '   t += format % ('black', '#aaffaa', branch)     tags = self.repo.nodetags(ctx.node())   format = '<span color="%s" background="%s"> %s </span> '   for tag in tags:   t += format % ('black', '#ffffaa', tag)     t += summary   label.set_markup(t)     def ishead(ctx): return len(ctx.children()) == 0     if self.mqmode:   ctxs = self.repo['.'].parents()   else:   ctxs = self.repo[None].parents()     ishead0 = ishead(ctxs[0])   setlabel(self.parent1_label, ctxs[0], ishead0)     merge = len(ctxs) == 2   if not merge:   self.parent2_label.hide()   else:   ishead1 = ishead(ctxs[1])   setlabel(self.parent2_label, ctxs[1], ishead1)     self.parent2_label.show()   self.parents_frame.set_label(_('Parents'))     if self.mqmode:   return     # add "{+|-}1 head" to label of commit button   b = self.commit_button   ph = _('_Commit (+1 head)')   mh = _('_Commit (-1 head)')   if not merge:   if not ishead0:   b.set_label(ph)   b.set_tooltip(self.tooltips,   _('parent is not a head, commit to add a new head'))   else:   if ishead0 and ishead1:   b.set_label(mh)   b.set_tooltip(self.tooltips,   _('commit to merge one head'))   elif not ishead0 and not ishead1:   b.set_label(ph)   b.set_tooltip(self.tooltips,   _('no parent is a head, commit to add a new head'))     def realize_settings(self):   self.vpaned.set_position(self.setting_vpos)   if not self.showparents:   self.parents_frame.hide()   if not self.showadvanced:   self.advanced_frame.hide()     def thgaccept(self, window):   self.commit_clicked(None)     def get_custom_menus(self):   def commit(menuitem, files):   if self.ready_message() and self.isuptodate():   self.hg_commit(files)   self.reload_status()   abs = [self.repo.wjoin(file) for file in files]   shlib.shell_notify(abs)   if self.merging:   return ()   else:   return [(_('_commit'), commit, 'MAR'),]     def delete(self, window, event):   if not self.should_live():   self.destroy()   else:   return True     def refresh_branchop(self):   if self.nextbranch:   text = _('new branch: ') + self.nextbranch   elif self.closebranch:   text = _('close branch: ') + self.repo[None].branch()   else:   text = _('branch: ') + self.repo[None].branch()   self.branchbutton.set_label(text)     def check_undo(self):   can_undo = os.path.exists(self.repo.sjoin("undo")) and \   self.last_commit_id is not None   self.undo_button.set_sensitive(can_undo)       def check_merge(self):   if self.merging:   # select all changes if repo is merged   for entry in self.filemodel:   if entry[FM_STATUS] in 'MARD':   entry[FM_CHECKED] = True   self.update_check_count()     # pre-fill commit message, if not modified   buf = self.text.get_buffer()   if not buf.get_modified():   buf.set_text(_('Merge '))   buf.set_modified(False)       def check_patch_queue(self):   'See if an MQ patch is applied, switch to qrefresh mode'   c_btn = self.get_toolbutton(_('_Commit'))   self.qheader = None   if self.mqmode:   qtipctx = self.repo['qtip']   self.qheader = qtipctx.description()   self.committer_cbbox.child.set_text(hglib.toutf(qtipctx.user()))   buf = self.text.get_buffer()   if buf.get_char_count() == 0 or not buf.get_modified():   if self.qnew:   buf.set_text('')   else:   buf.set_text(self.qheader)   buf.set_modified(False)   if self.qnew:   c_btn.set_label(_('QNew'))   c_btn.set_tooltip(self.tooltips, _('create new MQ patch'))   self.reload_status()   self.qnew_name.grab_focus()   self.qnew_name.set_position(-1)   else:   c_btn.set_label(_('QRefresh'))   c_btn.set_tooltip(self.tooltips, _('refresh top MQ patch'))   if not hasattr(self, 'patch_text'):   self.patch_text = gtk.TextView()   self.patch_text.set_wrap_mode(gtk.WRAP_NONE)   self.patch_text.set_editable(False)   self.patch_text.modify_font(self.difffont)   scroller = gtk.ScrolledWindow()   scroller.set_policy(gtk.POLICY_AUTOMATIC,   gtk.POLICY_AUTOMATIC)   scroller.add(self.patch_text)   self.diff_notebook.append_page(scroller,   gtk.Label(_('Patch Contents')))   self.diff_notebook.show_all()   revs = cmdutil.revrange(self.repo, ['tip'])   fp = cStringIO.StringIO()   opts = patch.diffopts(self.ui, self.opts)   patch.export(self.repo, revs, fp=fp, opts=opts)   text = fp.getvalue().splitlines(True)   buf = self.diff_highlight_buffer(text)   self.patch_text.set_buffer(buf)   elif self.qnew:   c_btn.set_label(_('QNew'))   c_btn.set_tooltip(self.tooltips, _('QNew'))   buf = self.text.get_buffer()   if not buf.get_modified():   buf.set_text('')   buf.set_modified(False)   if hasattr(self, 'patch_text'):   self.patch_text.set_buffer(gtk.TextBuffer())   else:   c_btn.set_label(_('_Commit'))   c_btn.set_tooltip(self.tooltips, _('commit'))   self.branchbutton.set_sensitive(not (self.mqmode or self.qnew))     def commit_clicked(self, toolbutton, data=None):   if not self.ready_message() or not self.isuptodate():   return     commitable = 'MAR'   if self.merging:   commit_list = self.relevant_checked_files(commitable)   # merges must be committed without specifying file list.   self.hg_commit([])   else:   addremove_list = self.relevant_checked_files('?!')   if len(addremove_list) and self.should_addremove(addremove_list):   commitable += '?!'     commit_list = self.relevant_checked_files(commitable)   if len(commit_list) > 0:   self.commit_selected(commit_list)   elif len(self.filemodel) == 0 and self.qnew:   self.commit_selected([])   elif self.qheader is not None:   self.commit_selected([])   elif self.closebranch:   self.commit_selected([])   else:   gdialog.Prompt(_('Nothing Commited'),   _('No committable files selected'), self).run()   return   self.reload_status()   files = [self.repo.wjoin(x) for x in commit_list]   shlib.shell_notify(files)     def commit_selected(self, files):   # 1a. get list of chunks not rejected   repo, ui = self.repo, self.repo.ui     # 2. backup changed files, so we can restore them in the end   backups = {}   backupdir = repo.join('record-backups')   try:   os.mkdir(backupdir)   except OSError, err:   if err.errno != errno.EEXIST:   gdialog.Prompt(_('Commit'),   _('Unable to create ') + backupdir, self).run()   return   try:   # backup continues   allchunks = []   for f in files:   cf = util.pconvert(f)   if cf not in self.status[0]: continue   if f not in self.filechunks: continue   chunks = self.filechunks[f]   if len(chunks) < 2: continue     # unfiltered files do not go through backup-revert-patch cycle   rejected = [c for c in chunks[1:] if not c.active]   if len(rejected) == 0: continue   allchunks.extend(chunks)   fd, tmpname = tempfile.mkstemp(prefix=cf.replace('/', '_')+'.',   dir=backupdir)   os.close(fd)   util.copyfile(repo.wjoin(cf), tmpname)   backups[cf] = tmpname     fp = cStringIO.StringIO()   for n, c in enumerate(allchunks):   if c.filename() in backups and c.active:   c.write(fp)   dopatch = fp.tell()   fp.seek(0)     if backups:   if self.qheader is not None:   # 3a. apply filtered patch to top patch's parent   hg.revert(repo, self._node1, backups.has_key)   else:   # 3a. apply filtered patch to clean repo (clean)   hg.revert(repo, repo.dirstate.parents()[0], backups.has_key)     # 3b. (apply)   if dopatch:   try:   pfiles = {}   patch.internalpatch(fp, ui, 1, repo.root, files=pfiles,   eolmode=None)   patch.updatedir(ui, repo, pfiles)   except patch.PatchError, err:   s = str(err)   if s:   raise util.Abort(s)   else:   gdialog.Prompt(_('Commit'),   _('Unable to apply patch'), self).run()   return   del fp     # 4. We prepared working directory according to filtered patch.   # Now is the time to delegate the job to commit/qrefresh   # or the like!   # it is important to first chdir to repo root -- we'll call a   # highlevel command with list of pathnames relative to repo root   cwd = os.getcwd()   os.chdir(repo.root)   try:   self.hg_commit(files)   finally:   os.chdir(cwd)     return   finally:   # 5. finally restore backed-up files   try:   for realname, tmpname in backups.iteritems():   util.copyfile(tmpname, repo.wjoin(realname))   os.unlink(tmpname)   os.rmdir(backupdir)   except OSError:   pass       def undo_clicked(self, toolbutton, data=None):   response = gdialog.Confirm(_('Confirm Undo Commit'),   [], self, _('Undo last commit')).run()   if response != gtk.RESPONSE_YES:   return     tip = self.get_tip_rev(True)   if not tip == self.last_commit_id:   gdialog.Prompt(_('Undo Commit'),   _('Unable to undo!\n\n'   'Tip revision differs from last commit.'),   self).run()   return     try:   self.repo.ui.quiet = True   self.repo.rollback()   self.repo.ui.quiet = False   self.last_commit_id = None   self.reload_status()   time.sleep(0.5) # give fs some time to pick up changes   shlib.shell_notify([os.getcwd()])   except:   gdialog.Prompt(_('Undo Commit'),   _('Errors during rollback!'), self).run()       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       def should_addremove(self, files):   if self.test_opt('addremove'):   return True   response = gdialog.Confirm(_('Confirm Add/Remove'),   files, self,_('Add/Remove the following files?')).run()   if response != gtk.RESPONSE_YES:   return False   # This will stay set for further commits (meaning no more   # prompts). Problem?   self.opts['addremove'] = True   if self.qnew or self.qheader is not None:   cmdline = ['hg', 'addremove', '--verbose']   cmdline += [self.repo.wjoin(x) for x in files]   dialog = hgcmd.CmdDialog(cmdline, True)   dialog.set_transient_for(self)   dialog.run()   dialog.hide()   return True     def ready_message(self):   buf = self.text.get_buffer()   if buf.get_char_count() == 0:   gdialog.Prompt(_('Nothing Commited'),   _('Please enter commit message'), self).run()   self.text.grab_focus()   return False     try:   sumlen = int(self.repo.ui.config('tortoisehg', 'summarylen', 0))   maxlen = int(self.repo.ui.config('tortoisehg', 'messagewrap', 0))   except (TypeError, ValueError):   gdialog.Prompt(_('Error'),   _('Message format configuration error'),   self).run()   self.msg_config(None)   return False     lines = buf.get_text(buf.get_start_iter(),   buf.get_end_iter()).splitlines()     if sumlen and len(lines[0].rstrip()) > sumlen:   resp = gdialog.Confirm(_('Confirm Commit'), [], self,   _('The summary line length of %i is greater than'   ' %i.\n\nIgnore format policy and continue'   ' commit?') %   (len(lines[0].rstrip()), sumlen)).run()   if resp != gtk.RESPONSE_YES:   return False   if sumlen and len(lines) > 1 and len(lines[1].strip()):   resp = gdialog.Confirm(_('Confirm Commit'), [], self,   _('The summary line is not followed by a blank'   ' line.\n\nIgnore format policy and continue'   ' commit?')).run()   if resp != gtk.RESPONSE_YES:   return False   if maxlen:   start = int(sumlen > 0)   tmp = [len(x.rstrip()) > maxlen for x in lines[start:]]   errs = [str(x[1]+start+1) for x in zip(tmp, range(len(tmp)))   if x[0]]   if errs:   resp = gdialog.Confirm(_('Confirm Commit'), [], self,   _('The following lines are over the %i-'   'character limit: %s.\n\nIgnore format'   ' policy and continue commit?') %   (maxlen, ', '.join(errs))).run()   if resp != gtk.RESPONSE_YES:   return False     begin, end = buf.get_bounds()   self.opts['message'] = buf.get_text(begin, end)   return True     def hg_commit(self, files):   # get advanced options   user = hglib.fromutf(self.committer_cbbox.get_active_text())   if not user:   gdialog.Prompt(_('Commit: Invalid username'),   _('Your username has not been configured.\n\n'   'Please configure your username and try again'),   self).run()     # bring up the config dialog for user to enter their username.   # But since we can't be sure they will do it right, we will   # have them to retry, to re-trigger the checking mechanism.   dlg = thgconfig.ConfigDialog(False)   dlg.show_all()   dlg.focus_field('ui.username')   dlg.run()   dlg.hide()   self.refreshui()   self.refresh_complete()   return     self.update_recent_committers(user)   self.opts['user'] = user   incs = hglib.fromutf(self.autoinc_entry.get_text())   self.opts['include'] = [i.strip() for i in incs.split(',') if i.strip()]   autopush = self.autopush.get_active()     cmdline = ['hg', 'commit', '--verbose']     if self.nextbranch:   # response: 0=Yes, 1=No, 2=Cancel   newbranch = hglib.fromutf(self.nextbranch)   if newbranch in self.repo.branchtags():   if newbranch in [p.branch() for p in self.repo.parents()]:   response = 0   else:   response = gdialog.CustomPrompt(_('Confirm Override Branch'),   _('A branch named "%s" already exists,\n'   'override?') % self.nextbranch, self,   (_('&Yes'), _('&No'), _('&Cancel')), 2, 2).run()   else:   response = gdialog.CustomPrompt(_('Confirm New Branch'),   _('Create new named branch "%s"?') % self.nextbranch,   self, (_('&Yes'), _('&No'), _('&Cancel')), 2, 2).run()   if response == 0:   self.repo.dirstate.setbranch(newbranch)   elif response == 2:   return   elif self.closebranch:   cmdline.append('--close-branch')     # call the threaded CmdDialog to do the commit, so the the large commit   # won't get locked up by potential large commit. CmdDialog will also   # display the progress of the commit operation.   if self.qnew:   cmdline[1] = 'qnew'   cmdline.append('--force')   elif self.qheader is not None:   cmdline[1] = 'qrefresh'   if not files:   cmdline += ['-X', self.repo.root]   elif self.opts['addremove']:   cmdline += ['--addremove']   if self.opts['user']:   cmdline.extend(['--user', self.opts['user']])   if self.opts['date']:   cmdline.extend(['--date', self.opts['date']])   files += self.opts['include']   cmdline += ['--message', hglib.fromutf(self.opts['message'])]   if self.qnew:   cmdline += [hglib.fromutf(self.get_qnew_name())]   cmdline += files   if autopush:   cmdline = (cmdline, ['hg', 'push'])   dialog = hgcmd.CmdDialog(cmdline, True)   dialog.set_transient_for(self)   dialog.run()   dialog.hide()     # refresh overlay icons and commit dialog   if dialog.return_code() == 0:   self.closebranch = False   self.nextbranch = None   self.filechunks = {} # force re-read of chunks   buf = self.text.get_buffer()   if buf.get_modified():   self.update_recent_messages(self.opts['message'])   buf.set_modified(False)   if self.qnew:   self.qnew_name.set_text('')   hglib.invalidaterepo(self.repo)   self.mode = 'commit'   self.qnew = False   elif self.qheader is None:   self.text.set_buffer(gtk.TextBuffer())   self.msg_cbbox.set_active(-1)   self.last_commit_id = self.get_tip_rev(True)   if self.notify_func:   self.notify_func(self.notify_args)     def get_tip_rev(self, refresh=False):   if refresh:   self.repo.invalidate()   return self.repo['tip'].node()     def get_qnew_name(self):   return self.qnew_name and self.qnew_name.get_text().strip() or ''     def qnew_changed(self, element):   qnew = bool(self.get_qnew_name())   if self.qnew != qnew:   self.qnew = qnew   self.mode = qnew and 'status' or 'commit'   self.reload_status()     def msg_add_to_popup(self, textview, menu):   menu_items = (('----', None),   (_('Paste _Filenames'), self.msg_paste_fnames),   (_('App_ly Format'), self.msg_word_wrap),   (_('C_onfigure Format'), self.msg_config))   for label, handler in menu_items:   if label == '----':   menuitem = gtk.SeparatorMenuItem()   else:   menuitem = gtk.MenuItem(label)   if handler:   menuitem.connect('activate', handler)   menu.append(menuitem)   menu.show_all()     def msg_paste_fnames(self, sender):   buf = self.text.get_buffer()   fnames = [ file[FM_PATH_UTF8] for file in self.filemodel   if file[FM_CHECKED] ]   buf.delete_selection(True, True)   buf.insert_at_cursor('\n'.join(fnames))     def msg_word_wrap(self, sender):   try:   sumlen = int(self.repo.ui.config('tortoisehg', 'summarylen', 0))   maxlen = int(self.repo.ui.config('tortoisehg', 'messagewrap', 0))   except (TypeError, ValueError):   sumlen = 0   maxlen = 0   if not (sumlen or maxlen):   gdialog.Prompt(_('Info Required'),   _('Message format needs to be configured'),   self).run()   self.msg_config(None)   return     buf = self.text.get_buffer()   lines = buf.get_text(buf.get_start_iter(),   buf.get_end_iter()).splitlines()   if not lines:   return     if sumlen and len(lines[0].rstrip()) > sumlen:   gdialog.Prompt(_('Warning'),   _('The summary line length of %i is greater than %i') %   (len(lines[0].rstrip()), sumlen),   self).run()   if sumlen and len(lines) > 1 and len(lines[1].strip()):   gdialog.Prompt(_('Warning'),   _('The summary line is not followed by a blank line'),   self).run()   if not maxlen:   return     lnum = int(sumlen > 0)   while lnum < len(lines):   lines[lnum] = lines[lnum].rstrip() + ' '   if lines[lnum].endswith('. '):   lines[lnum] += ' '   if len(lines[lnum].rstrip()) > maxlen:   ind = lines[lnum].rfind(' ', 0, maxlen+1) + 1   if ind > 0:   if lnum == len(lines)-1 or not lines[lnum+1].strip():   lines.insert(lnum+1, lines[lnum][ind:].lstrip())   else:   lines[lnum+1] = lines[lnum][ind:].lstrip() \   + lines[lnum+1]   lines[lnum] = lines[lnum][0:ind].rstrip()   lnum += 1   buf.set_text('\n'.join(lines))     def msg_config(self, sender):   dlg = thgconfig.ConfigDialog(True)   dlg.show_all()   dlg.focus_field('tortoisehg.summarylen')   dlg.run()   dlg.hide()   self.refreshui()   return      def run(_ui, *pats, **opts):   cmdoptions = {   'user':opts.get('user', ''), 'date':opts.get('date', ''),   'logfile':'', 'message':'',   'modified':True, 'added':True, 'removed':True, 'deleted':True,   'unknown':True, 'ignored':False,   'exclude':[], 'include':[], 'rev':[],   'check': True, 'git':False, 'addremove':False,   }   return GCommit(_ui, None, None, pats, cmdoptions)
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 Entire File tortoisehg/​hgtk/​history.py Stacked
renamed from hggtk/history.py
 
14
15
16
17
18
 
 
19
20
 
21
22
23
24
 
 
 
25
26
27
 
122
123
124
125
 
126
127
128
 
14
15
16
 
 
17
18
19
 
20
21
 
 
 
22
23
24
25
26
27
 
122
123
124
 
125
126
127
128
@@ -14,14 +14,14 @@
   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) @@ -122,7 +122,7 @@
  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)
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',