Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9, 1.9.1, and 1.9.2

eliminate hgqt/hgviewlib/qt4 subdirectory

Changeset 9c0e71b66a30

Parent dcfd73d6a5a1

by Adrian Buehlmann

Changes to 43 files · Browse files at 9c0e71b66a30 Showing diff from parent dcfd73d6a5a1 Diff from another changeset...

Show Entire File tortoisehg/​hgqt/​hgviewlib/​__init__.py Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/__init__.py
(No changes)
Show Entire File tortoisehg/​hgqt/​hgviewlib/​blockmatcher.py Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/blockmatcher.py
(No changes)
Show Entire File tortoisehg/​hgqt/​hgviewlib/​filediffviewer.ui Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/filediffviewer.ui
(No changes)
Show Entire File tortoisehg/​hgqt/​hgviewlib/​fileviewer.ui Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/fileviewer.ui
(No changes)
Change 1 of 1 Show Entire File tortoisehg/​hgqt/​hgviewlib/​helpviewer.py Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/helpviewer.py
 
14
15
16
17
18
 
 
19
20
21
 
14
15
16
 
 
17
18
19
20
21
@@ -14,8 +14,8 @@
   from PyQt4 import QtCore, QtGui, Qsci   -from tortoisehg.hgqt.hgviewlib.qt4 import icon as geticon -from tortoisehg.hgqt.hgviewlib.qt4.hgdialogmixin import HgDialogMixin +from tortoisehg.hgqt.hgviewlib import icon as geticon +from tortoisehg.hgqt.hgviewlib.hgdialogmixin import HgDialogMixin  from tortoisehg.hgqt.hgviewlib.hgviewhelp import help_msg, get_options_helpmsg    Qt = QtCore.Qt
Show Entire File tortoisehg/​hgqt/​hgviewlib/​helpviewer.ui Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/helpviewer.ui
(No changes)
Show Entire File tortoisehg/​hgqt/​hgviewlib/​helpviewer_ui.py Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/helpviewer_ui.py
(No changes)
Change 1 of 2 Show Entire File tortoisehg/​hgqt/​hgviewlib/​hgdialogmixin.py Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/hgdialogmixin.py
 
29
30
31
32
 
33
34
35
 
50
51
52
53
 
54
55
56
 
29
30
31
 
32
33
34
35
 
50
51
52
 
53
54
55
56
@@ -29,7 +29,7 @@
 Qt = QtCore.Qt    from tortoisehg.hgqt.hgviewlib.config import HgConfig -from tortoisehg.hgqt.hgviewlib.qt4 import should_rebuild +from tortoisehg.hgqt.hgviewlib import should_rebuild    class HgDialogMixin(object):   """ @@ -50,7 +50,7 @@
  os.system('pyuic4 %s -o %s' % (uifile, pyfile))   try:   modname = osp.splitext(osp.basename(uifile))[0] + "_ui" - modname = "hgviewlib.qt4.%s" % modname + modname = "hgviewlib.%s" % modname   mod = __import__(modname, fromlist=['*'])   classnames = [x for x in dir(mod) if x.startswith('Ui_')]   if len(classnames) == 1:
Change 1 of 2 Show Entire File tortoisehg/​hgqt/​hgviewlib/​hgfiledialog.py Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/hgfiledialog.py
 
30
31
32
33
34
35
36
37
38
 
 
 
 
 
 
39
40
41
 
104
105
106
107
 
108
109
110
 
30
31
32
 
 
 
 
 
 
33
34
35
36
37
38
39
40
41
 
104
105
106
 
107
108
109
110
@@ -30,12 +30,12 @@
   from tortoisehg.util.util import tounicode, rootpath   -from tortoisehg.hgqt.hgviewlib.qt4 import icon as geticon -from tortoisehg.hgqt.hgviewlib.qt4.hgdialogmixin import HgDialogMixin -from tortoisehg.hgqt.hgviewlib.qt4.hgrepomodel import FileRevModel -from tortoisehg.hgqt.hgviewlib.qt4.blockmatcher import BlockList, BlockMatch -from tortoisehg.hgqt.hgviewlib.qt4.lexers import get_lexer -from tortoisehg.hgqt.hgviewlib.qt4.quickbar import FindInGraphlogQuickBar +from tortoisehg.hgqt.hgviewlib import icon as geticon +from tortoisehg.hgqt.hgviewlib.hgdialogmixin import HgDialogMixin +from tortoisehg.hgqt.hgviewlib.hgrepomodel import FileRevModel +from tortoisehg.hgqt.hgviewlib.blockmatcher import BlockList, BlockMatch +from tortoisehg.hgqt.hgviewlib.lexers import get_lexer +from tortoisehg.hgqt.hgviewlib.quickbar import FindInGraphlogQuickBar    connect = QtCore.QObject.connect  disconnect = QtCore.QObject.disconnect @@ -104,7 +104,7 @@
  """   if self.repoviewer is None:   # prevent recursive import - from hgviewlib.qt4.hgrepoviewer import HgRepoViewer + from hgviewlib.hgrepoviewer import HgRepoViewer   self.repoviewer = HgRepoViewer(self.repo)   self.repoviewer.goto(rev)   self.repoviewer.show()
Change 1 of 1 Show Entire File tortoisehg/​hgqt/​hgviewlib/​hgfileview.py Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/hgfileview.py
 
37
38
39
40
41
42
43
44
45
 
 
 
 
 
 
46
47
48
 
37
38
39
 
 
 
 
 
 
40
41
42
43
44
45
46
47
48
@@ -37,12 +37,12 @@
 from tortoisehg.hgqt.hgviewlib.decorators import timeit  from tortoisehg.hgqt.hgviewlib.config import HgConfig   -from tortoisehg.hgqt.hgviewlib.qt4 import icon as geticon -from tortoisehg.hgqt.hgviewlib.qt4.hgfiledialog import FileViewer, FileDiffViewer -from tortoisehg.hgqt.hgviewlib.qt4.hgmanifestdialog import ManifestViewer -from tortoisehg.hgqt.hgviewlib.qt4.quickbar import QuickBar -from tortoisehg.hgqt.hgviewlib.qt4.lexers import get_lexer -from tortoisehg.hgqt.hgviewlib.qt4.blockmatcher import BlockList +from tortoisehg.hgqt.hgviewlib import icon as geticon +from tortoisehg.hgqt.hgviewlib.hgfiledialog import FileViewer, FileDiffViewer +from tortoisehg.hgqt.hgviewlib.hgmanifestdialog import ManifestViewer +from tortoisehg.hgqt.hgviewlib.quickbar import QuickBar +from tortoisehg.hgqt.hgviewlib.lexers import get_lexer +from tortoisehg.hgqt.hgviewlib.blockmatcher import BlockList    qsci = Qsci.QsciScintilla  
Change 1 of 1 Show Entire File tortoisehg/​hgqt/​hgviewlib/​hgmanifestdialog.py Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/hgmanifestdialog.py
 
29
30
31
32
33
34
35
 
 
 
 
36
37
38
 
29
30
31
 
 
 
 
32
33
34
35
36
37
38
@@ -29,10 +29,10 @@
   from tortoisehg.util.util import tounicode   -from tortoisehg.hgqt.hgviewlib.qt4 import icon as geticon -from tortoisehg.hgqt.hgviewlib.qt4.hgdialogmixin import HgDialogMixin -from tortoisehg.hgqt.hgviewlib.qt4.hgrepomodel import ManifestModel -from tortoisehg.hgqt.hgviewlib.qt4.lexers import get_lexer +from tortoisehg.hgqt.hgviewlib import icon as geticon +from tortoisehg.hgqt.hgviewlib.hgdialogmixin import HgDialogMixin +from tortoisehg.hgqt.hgviewlib.hgrepomodel import ManifestModel +from tortoisehg.hgqt.hgviewlib.lexers import get_lexer    connect = QtCore.QObject.connect  disconnect = QtCore.QObject.disconnect
Show Entire File tortoisehg/​hgqt/​hgviewlib/​hgqv.qrc Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/hgqv.qrc
(No changes)
Show Entire File tortoisehg/​hgqt/​hgviewlib/​hgqv.ui Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/hgqv.ui
(No changes)
Show Entire File tortoisehg/​hgqt/​hgviewlib/​hgqv_rc.py Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/hgqv_rc.py
(No changes)
Show Entire File tortoisehg/​hgqt/​hgviewlib/​hgqv_ui.py Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/hgqv_ui.py
(No changes)
Change 1 of 1 Show Changes Only tortoisehg/​hgqt/​hgviewlib/​hgrepomodel.py Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/hgrepomodel.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
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
 # Copyright (c) 2009-2010 LOGILAB S.A. (Paris, FRANCE).  # http://www.logilab.fr/ -- mailto:contact@logilab.fr  #  # This program is free software; you can redistribute it and/or modify it under  # the terms of the GNU General Public License as published by the Free Software  # Foundation; either version 2 of the License, or (at your option) any later  # version.  #  # This program is distributed in the hope that it will be useful, but WITHOUT  # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS  # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.  #  # You should have received a copy of the GNU General Public License along with  # this program; if not, write to the Free Software Foundation, Inc.,  # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  """  Qt4 model for hg repo changelogs and filelogs  """  import sys  import mx.DateTime as dt  import re  import os, os.path as osp    from mercurial.node import nullrev  from mercurial.node import hex, short as short_hex  from mercurial.revlog import LookupError  from mercurial import util, error    from tortoisehg.util.util import tounicode, isbfile, Curry    from tortoisehg.hgqt.hgviewlib.hggraph import Graph, ismerge, diff as revdiff  from tortoisehg.hgqt.hgviewlib.hggraph import revision_grapher, filelog_grapher  from tortoisehg.hgqt.hgviewlib.config import HgConfig -from tortoisehg.hgqt.hgviewlib.qt4 import icon as geticon +from tortoisehg.hgqt.hgviewlib import icon as geticon  from tortoisehg.hgqt.hgviewlib.decorators import timeit    from PyQt4 import QtCore, QtGui  connect = QtCore.QObject.connect  SIGNAL = QtCore.SIGNAL  nullvariant = QtCore.QVariant()    # XXX make this better than a poor hard written list...  COLORS = [ "blue", "darkgreen", "red", "green", "darkblue", "purple",   "cyan", QtCore.Qt.darkYellow, "magenta", "darkred", "darkmagenta",   "darkcyan", "gray", "yellow", ]  COLORS = [str(QtGui.QColor(x).name()) for x in COLORS]  #COLORS = [str(color) for color in QtGui.QColor.colorNames()]    def get_color(n, ignore=()):   """   Return a color at index 'n' rotating in the available   colors. 'ignore' is a list of colors not to be chosen.   """   ignore = [str(QtGui.QColor(x).name()) for x in ignore]   colors = [x for x in COLORS if x not in ignore]   if not colors: # ghh, no more available colors...   colors = COLORS   return colors[n % len(colors)]    def cvrt_date(date):   """   Convert a date given the hg way, ie. couple (date, tz), into a   formatted QString   """   date, tzdelay = date   return QtCore.QDateTime.fromTime_t(int(date)).toString(QtCore.Qt.LocaleDate)    def gettags(model, ctx, gnode):   if ctx.rev() is None:   return ""   mqtags = ['qbase', 'qtip', 'qparent']   tags = ctx.tags()   if model.hide_mq_tags:   tags = [t for t in tags if t not in mqtags]   return ",".join(tags)    def getlog(model, ctx, gnode):   if ctx.rev() is not None:   msg = tounicode(ctx.description())   if msg:   msg = msg.splitlines()[0]   else:   msg = "WORKING DIRECTORY (locally modified)"   return msg    # XXX maybe it's time to make these methods of the model...  # in following lambdas, ctx is a hg changectx  _columnmap = {'ID': lambda model, ctx, gnode: ctx.rev() is not None and str(ctx.rev()) or "",   'Log': getlog,   'Author': lambda model, ctx, gnode: tounicode(ctx.user()),   'Date': lambda model, ctx, gnode: cvrt_date(ctx.date()),   'Tags': gettags,   'Branch': lambda model, ctx, gnode: ctx.branch(),   'Filename': lambda model, ctx, gnode: gnode.extra[0],   }    _tooltips = {'ID': lambda model, ctx, gnode: ctx.rev() is not None and ctx.hex() or "Working Directory",   }    def auth_width(model, repo):   auths = model._aliases.values()   if not auths:   return None   return sorted(auths, cmp=lambda x,y: cmp(len(x), len(y)))[-1]    # in following lambdas, r is a hg repo  _maxwidth = {'ID': lambda self, r: str(len(r.changelog)),   'Date': lambda self, r: cvrt_date(r.changectx(0).date()),   'Tags': lambda self, r: sorted(r.tags().keys(),   key=lambda x: len(x))[-1][:10],   'Branch': lambda self, r: sorted(r.branchtags().keys(),   key=lambda x: len(x))[-1],   'Author': lambda self, r: 'author name',   'Filename': lambda self, r: self.filename,   }    def datacached(meth):   """   decorator used to cache 'data' method of Qt models. It will *not*   cache nullvariant return values (so costly non-null values   can be computed and filled as a background process)   """   def data(self, index, role):   if not index.isValid():   return nullvariant   row = index.row()   col = index.column()   if (row, col, role) in self._datacache:   return self._datacache[(row, col, role)]   result = meth(self, index, role)   if result is not nullvariant:   self._datacache[(row, col, role)] = result   return result   return data    class HgRepoListModel(QtCore.QAbstractTableModel):   """   Model used for displaying the revisions of a Hg *local* repository   """   _allcolumns = ('ID', 'Branch', 'Log', 'Author', 'Date', 'Tags',)   _columns = ('ID', 'Branch', 'Log', 'Author', 'Date', 'Tags',)   _stretchs = {'Log': 1, }   _getcolumns = "getChangelogColumns"     def __init__(self, repo, branch='', fromhead=None, follow=False, parent=None):   """   repo is a hg repo instance   """   QtCore.QAbstractTableModel.__init__(self, parent)   self._datacache = {}   self._hasmq = False   self.mqueues = []   self.wd_revs = []   self.graph = None   self._fill_timer = None   self.rowcount = 0   self.repo = repo   self.load_config()   self.setRepo(repo, branch=branch, fromhead=fromhead, follow=follow)     def setRepo(self, repo, branch='', fromhead=None, follow=False):   oldrepo = self.repo   self.repo = repo   if oldrepo.root != repo.root:   self.load_config()   self._datacache = {}   try:   wdctxs = self.repo.changectx(None).parents()   except error.Abort:   # might occur if reloading during a mq operation (or   # whatever operation playing with hg history)   return   self._hasmq = hasattr(self.repo, "mq")   if self._hasmq:   self.mqueues = self.repo.mq.series[:]   self.wd_revs = [ctx.rev() for ctx in wdctxs]   self.wd_status = [self.repo.status(ctx.node(), None)[:4] for ctx in wdctxs]   self._user_colors = {}   self._branch_colors = {}   grapher = revision_grapher(self.repo, start_rev=fromhead,   follow=follow, branch=branch)   self.graph = Graph(self.repo, grapher, self.max_file_size)   self.rowcount = 0   self.emit(SIGNAL('layoutChanged()'))   self.heads = [self.repo.changectx(x).rev() for x in self.repo.heads()]   self.ensureBuilt(row=self.fill_step)   QtCore.QTimer.singleShot(0, Curry(self.emit, SIGNAL('filled')))   self._fill_timer = self.startTimer(50)     def ensureBuilt(self, rev=None, row=None):   """   Make sure rev data is available (graph element created).     """   if self.graph.isfilled():   return   required = 0   buildrev = rev   n = len(self.graph)   if rev is not None:   if n and self.graph[-1].rev <= rev:   buildrev = None   else:   required = self.fill_step/2   elif row is not None and row > (n - self.fill_step / 2):   required = row - n + self.fill_step   if required or buildrev:   self.graph.build_nodes(nnodes=required, rev=buildrev)   self.updateRowCount()   elif row and row > self.rowcount:   # asked row was already built, but views where not aware of this   self.updateRowCount()   elif rev is not None and rev <= self.graph[self.rowcount].rev:   # asked rev was already built, but views where not aware of this   self.updateRowCount()     def timerEvent(self, event):   if event.timerId() == self._fill_timer:   self.emit(SIGNAL('showMessage'), 'filling (%s)'%(len(self.graph)))   if self.graph.isfilled():   self.killTimer(self._fill_timer)   self._fill_timer = None   self.emit(SIGNAL('showMessage'), '')   # we only fill the graph data strctures without telling   # views (until we atually did the full job), to keep   # maximal GUI reactivity   elif not self.graph.build_nodes(nnodes=self.fill_step):   self.killTimer(self._fill_timer)   self._fill_timer = None   self.updateRowCount()   self.emit(SIGNAL('showMessage'), '')     def updateRowCount(self):   currentlen = self.rowcount   newlen = len(self.graph)   if newlen > self.rowcount:   self.beginInsertRows(QtCore.QModelIndex(), currentlen, newlen-1)   self.rowcount = newlen   self.endInsertRows()     def rowCount(self, parent=None):   return self.rowcount     def columnCount(self, parent=None):   return len(self._columns)     def load_config(self):   cfg = HgConfig(self.repo.ui)   self._users, self._aliases = cfg.getUsers()   self.dot_radius = cfg.getDotRadius(default=8)   self.rowheight = cfg.getRowHeight()   self.fill_step = cfg.getFillingStep()   self.max_file_size = cfg.getMaxFileSize()   self.hide_mq_tags = cfg.getMQHideTags()     cols = getattr(cfg, self._getcolumns)()   if cols is not None:   validcols = [col for col in cols if col in self._allcolumns]   if len(validcols) != len(cols):   wrongcols = [col for col in cols if col not in self._allcolumns]   print "WARNING! %s are not valid column names. Check your configuration." % ','.join(wrongcols)   print " reverting to default columns configuration"   elif 'Log' not in validcols or 'ID' not in validcols:   print "WARNING! 'Log' and 'ID' are mandatory. Check your configuration."   print " reverting to default columns configuration"   else:   self._columns = tuple(validcols)     def maxWidthValueForColumn(self, column):   column = self._columns[column]   if column in _maxwidth:   return _maxwidth[column](self, self.repo)   return None     def user_color(self, user):   if user in self._aliases:   user = self._aliases[user]   if user in self._users:   try:   color = self._users[user]['color']   color = QtGui.QColor(color).name()   self._user_colors[user] = color   except:   pass   if user not in self._user_colors:   self._user_colors[user] = get_color(len(self._user_colors),   self._user_colors.values())   return self._user_colors[user]     def user_name(self, user):   return self._aliases.get(user, user)     def namedbranch_color(self, branch):   if branch not in self._branch_colors:   self._branch_colors[branch] = get_color(len(self._branch_colors))   return self._branch_colors[branch]     def col2x(self, col):   return (1.2*self.dot_radius + 0) * col + self.dot_radius/2 + 3     @datacached   def data(self, index, role):   if not index.isValid():   return nullvariant   row = index.row()   self.ensureBuilt(row=row)   column = self._columns[index.column()]   gnode = self.graph[row]   ctx = self.repo.changectx(gnode.rev)   if role == QtCore.Qt.DisplayRole:   if column == 'Author': #author   return QtCore.QVariant(self.user_name(_columnmap[column](self, ctx, gnode)))   elif column == 'Log':   msg = _columnmap[column](self, ctx, gnode)   return QtCore.QVariant(msg)   return QtCore.QVariant(_columnmap[column](self, ctx, gnode))   elif role == QtCore.Qt.ToolTipRole:   msg = "<b>Branch:</b> %s<br>\n" % ctx.branch()   if gnode.rev in self.wd_revs:   msg += " <i>Working Directory position"   states = 'modified added removed deleted'.split()   status = self.wd_status[self.wd_revs.index(gnode.rev)]   status = [state for st, state in zip(status, states) if st]   if status:   msg += ' (%s)' % (', '.join(status))   msg += "</i><br>\n"   msg += _tooltips.get(column, _columnmap[column])(self, ctx, gnode)   return QtCore.QVariant(msg)   elif role == QtCore.Qt.ForegroundRole:   if column == 'Author': #author   return QtCore.QVariant(QtGui.QColor(self.user_color(ctx.user())))   if column == 'Branch': #branch   return QtCore.QVariant(QtGui.QColor(self.namedbranch_color(ctx.branch())))   elif role == QtCore.Qt.DecorationRole:   if column == 'Log':   radius = self.dot_radius   w = (gnode.cols)*(1*radius + 0) + 20   h = self.rowheight     dot_x = self.col2x(gnode.x) - radius / 2   dot_y = h / 2     pix = QtGui.QPixmap(w, h)   pix.fill(QtGui.QColor(0,0,0,0))   painter = QtGui.QPainter(pix)   painter.setRenderHint(QtGui.QPainter.Antialiasing)     pen = QtGui.QPen(QtCore.Qt.blue)   pen.setWidth(2)   painter.setPen(pen)     lpen = QtGui.QPen(pen)   lpen.setColor(QtCore.Qt.black)   painter.setPen(lpen)     for y1, y2, lines in ((0, h, gnode.bottomlines),   (-h, 0, gnode.toplines)):   for start, end, color in lines:   lpen = QtGui.QPen(pen)   lpen.setColor(QtGui.QColor(get_color(color)))   lpen.setWidth(2)   painter.setPen(lpen)   x1 = self.col2x(start)   x2 = self.col2x(end)   painter.drawLine(x1, dot_y + y1, x2, dot_y + y2)     dot_color = QtGui.QColor(self.namedbranch_color(ctx.branch()))   dotcolor = QtGui.QColor(dot_color)   if gnode.rev in self.heads:   penradius = 2   pencolor = dotcolor.darker()   else:   penradius = 1   pencolor = QtCore.Qt.black     dot_y = (h/2) - radius / 2     painter.setBrush(dotcolor)   pen = QtGui.QPen(pencolor)   pen.setWidth(penradius)   painter.setPen(pen)   tags = set(ctx.tags())   icn = None     modified = False   atwd = False   if gnode.rev in self.wd_revs:   atwd = True   status = self.wd_status[self.wd_revs.index(gnode.rev)]   if [True for st in status if st]:   modified = True     if gnode.rev is None:   # WD is displayed only if there are local   # modifications, so let's use the modified icon   icn = geticon('modified')   elif tags.intersection(self.mqueues):   icn = geticon('mqpatch')   #elif modified:   # icn = geticon('modified')   elif atwd:   icn = geticon('clean')     if icn:   icn.paint(painter, dot_x-5, dot_y-5, 17, 17)   else:   painter.drawEllipse(dot_x, dot_y, radius, radius)   painter.end()   ret = QtCore.QVariant(pix)   return ret   return nullvariant     def headerData(self, section, orientation, role):   if orientation == QtCore.Qt.Horizontal and role == QtCore.Qt.DisplayRole:   return QtCore.QVariant(self._columns[section])   return nullvariant     def rowFromRev(self, rev):   row = self.graph.index(rev)   if row == -1:   row = None   return row     def indexFromRev(self, rev):   self.ensureBuilt(rev=rev)   row = self.rowFromRev(rev)   if row is not None:   return self.index(row, 0)   return None     def clear(self):   """empty the list"""   self.graph = None   self._datacache = {}   self.notify_data_changed()     def notify_data_changed(self):   self.emit(SIGNAL("layoutChanged()"))    class FileRevModel(HgRepoListModel):   """   Model used to manage the list of revisions of a file, in file   viewer of in diff-file viewer dialogs.   """   _allcolumns = ('ID', 'Branch', 'Log', 'Author', 'Date', 'Tags', 'Filename')   _columns = ('ID', 'Branch', 'Log', 'Author', 'Date', 'Filename')   _stretchs = {'Log': 1, }   _getcolumns = "getFilelogColumns"     def __init__(self, repo, filename=None, parent=None):   """   data is a HgHLRepo instance   """   HgRepoListModel.__init__(self, repo, parent=parent)   self.setFilename(filename)     def setRepo(self, repo, branch='', fromhead=None, follow=False):   self.repo = repo   self._datacache = {}   self.load_config()     def setFilename(self, filename):   self.filename = filename     self._user_colors = {}   self._branch_colors = {}     self.rowcount = 0   self._datacache = {}     if self.filename:   grapher = filelog_grapher(self.repo, self.filename)   self.graph = Graph(self.repo, grapher, self.max_file_size)   fl = self.repo.file(self.filename)   # we use fl.index here (instead of linkrev) cause   # linkrev API changed between 1.0 and 1.?. So this   # works with both versions.   self.heads = [fl.index[fl.rev(x)][4] for x in fl.heads()]   self.ensureBuilt(row=self.fill_step/2)   QtCore.QTimer.singleShot(0, Curry(self.emit, SIGNAL('filled')))   self._fill_timer = self.startTimer(500)   else:   self.graph = None   self.heads = []      replus = re.compile(r'^[+][^+].*', re.M)  reminus = re.compile(r'^[-][^-].*', re.M)    class HgFileListModel(QtCore.QAbstractTableModel):   """   Model used for listing (modified) files of a given Hg revision   """   def __init__(self, repo, parent=None):   """   data is a HgHLRepo instance   """   QtCore.QAbstractTableModel.__init__(self, parent)   self.repo = repo   self._datacache = {}   self.load_config()   self.current_ctx = None   self._files = []   self._filesdict = {}   self.diffwidth = 100   self._fulllist = False   self._fill_iter = None     def toggleFullFileList(self):   self._fulllist = not self._fulllist   self.loadFiles()   self.emit(SIGNAL('layoutChanged()'))     def load_config(self):   cfg = HgConfig(self.repo.ui)   self._flagcolor = {}   self._flagcolor['='] = cfg.getFileModifiedColor(default='blue')   self._flagcolor['-'] = cfg.getFileRemovedColor(default='red')   self._flagcolor['-'] = cfg.getFileDeletedColor(default='red')   self._flagcolor['+'] = cfg.getFileAddedColor(default='green')   self._displaydiff = cfg.getDisplayDiffStats()     def setDiffWidth(self, w):   if w != self.diffwidth:   self.diffwidth = w   self._datacache = {}   self.emit(SIGNAL('dataChanged(const QModelIndex &, const QModelIndex & )'),   self.index(1, 0),   self.index(1, self.rowCount()))     def __len__(self):   return len(self._files)     def rowCount(self, parent=None):   return len(self)     def columnCount(self, parent=None):   return 1 + self._displaydiff     def file(self, row):   return self._files[row]['path']     def fileflag(self, fn):   return self._filesdict[fn]['flag']     def fileparentctx(self, fn, ctx=None):   if ctx is None:   return self._filesdict[fn]['parent']   return ctx.parents()[0]     def fileFromIndex(self, index):   if not index.isValid() or index.row()>=len(self) or not self.current_ctx:   return None   row = index.row()   return self._files[row]['path']     def revFromIndex(self, index):   if self._fulllist and ismerge(self.current_ctx):   if not index.isValid() or index.row()>=len(self) or not self.current_ctx:   return None   row = index.row()   current_file_desc = self._files[row]   if current_file_desc['fromside'] == 'right':   return self.current_ctx.parents()[1].rev()   else:   return self.current_ctx.parents()[0].rev()   return None     def indexFromFile(self, filename):   if filename in self._filesdict:   row = self._files.index(self._filesdict[filename])   return self.index(row, 0)   return QtCore.QModelIndex()     def _filterFile(self, filename, ctxfiles):   if self._fulllist:   return True   return filename in ctxfiles #self.current_ctx.files()     def _buildDesc(self, parent, fromside):   _files = []   ctx = self.current_ctx   ctxfiles = ctx.files()   changes = self.repo.status(parent.node(), ctx.node())[:3]   modified, added, removed = changes   for lst, flag in ((added, '+'), (modified, '='), (removed, '-')):   for f in [x for x in lst if self._filterFile(x, ctxfiles)]:   _files.append({'path': f, 'flag': flag, 'desc': f,   'parent': parent, 'fromside': fromside,   'infiles': f in ctxfiles})   # renamed/copied files are handled by background   # filling process since it can be a bit long   for fdesc in _files:   bfile = isbfile(fdesc['path'])   fdesc['bfile'] = bfile   if bfile:   fdesc['desc'] = fdesc['desc'].replace('.hgbfiles'+os.sep, '')     return _files     def loadFiles(self):   self._fill_iter = None   self._files = []   self._datacache = {}   self._files = self._buildDesc(self.current_ctx.parents()[0], 'left')   if ismerge(self.current_ctx):   _paths = [x['path'] for x in self._files]   _files = self._buildDesc(self.current_ctx.parents()[1], 'right')   self._files += [x for x in _files if x['path'] not in _paths]   self._filesdict = dict([(f['path'], f) for f in self._files])   self.fillFileStats()     def setSelectedRev(self, ctx):   if ctx != self.current_ctx:   self.current_ctx = ctx   self._datacache = {}   self.loadFiles()   self.emit(SIGNAL("layoutChanged()"))     def fillFileStats(self):   """   Method called to start the background process of computing   file stats, which are to be displayed in the 'Stats' column   """   self._fill_iter = self._fill()   self._fill_one_step()     def _fill_one_step(self):   if self._fill_iter is None:   return   try:   nextfill = self._fill_iter.next()   if nextfill is not None:   row, col = nextfill   idx = self.index(row, col)   self.emit(SIGNAL('dataChanged(const QModelIndex &, const QModelIndex &)'),   idx, idx)   QtCore.QTimer.singleShot(10, lambda self=self: self._fill_one_step())     except StopIteration:   self._fill_iter = None     def _fill(self):   # the generator used to fill file stats as a background process   for row, desc in enumerate(self._files):   filename = desc['path']   if desc['flag'] == '=' and self._displaydiff:   diff = revdiff(self.repo, self.current_ctx, desc['parent'],   files=[filename])   try:   tot = self.current_ctx.filectx(filename).data().count('\n')   except LookupError:   tot = 0   add = len(replus.findall(diff))   rem = len(reminus.findall(diff))   if tot == 0:   tot = max(add + rem, 1)   desc['stats'] = (tot, add, rem)   yield row, 1     if desc['flag'] == '+':   m = self.current_ctx.filectx(filename).renamed()   if m:   removed = self.repo.status(desc['parent'].node(),   self.current_ctx.node())[2]   oldname, node = m   if oldname in removed:   # removed.remove(oldname) XXX   desc['renamedfrom'] = (oldname, node)   desc['flag'] = '='   desc['desc'] += '\n (was %s)' % oldname   else:   desc['copiedfrom'] = (oldname, node)   desc['flag'] = '='   desc['desc'] += '\n (copy of %s)' % oldname   yield row, 0   yield None     def data(self, index, role):   if not index.isValid() or index.row()>len(self) or not self.current_ctx:   return nullvariant   row = index.row()   column = index.column()     current_file_desc = self._files[row]   current_file = current_file_desc['path']   stats = current_file_desc.get('stats')   if column == 1:   if stats is not None:   if role == QtCore.Qt.DecorationRole:   tot, add, rem = stats   w = self.diffwidth - 20   h = 20     np = int(w*add/tot)   nm = int(w*rem/tot)   nd = w-np-nm     pix = QtGui.QPixmap(w+10, h)   pix.fill(QtGui.QColor(0,0,0,0))   painter = QtGui.QPainter(pix)     for x0,w0, color in ((0, nm, 'red'),   (nm, np, 'green'),   (nm+np, nd, 'gray')):   color = QtGui.QColor(color)   painter.setBrush(color)   painter.setPen(color)   painter.drawRect(x0+5, 0, w0, h-3)   painter.setBrush(QtGui.QColor(0,0,0,0))   pen = QtGui.QPen(QtCore.Qt.black)   pen.setWidth(0)   painter.setPen(pen)   painter.drawRect(5, 0, w+1, h-3)   painter.end()   return QtCore.QVariant(pix)   elif role == QtCore.Qt.ToolTipRole:   tot, add, rem = stats   msg = "Diff stats:<br>"   msg += "&nbsp;<b>File:&nbsp;</b>%s lines<br>" % tot   msg += "&nbsp;<b>added lines:&nbsp;</b> %s<br>" % add   msg += "&nbsp;<b>removed lines:&nbsp;</b> %s" % rem   return QtCore.QVariant(msg)     elif column == 0:   if role in (QtCore.Qt.DisplayRole, QtCore.Qt.ToolTipRole):   return QtCore.QVariant(current_file_desc['desc'])   elif role == QtCore.Qt.DecorationRole:   if self._fulllist and ismerge(self.current_ctx):   if current_file_desc['infiles']:   icn = geticon('leftright')   elif current_file_desc['fromside'] == 'left':   icn = geticon('left')   elif current_file_desc['fromside'] == 'right':   icn = geticon('right')   return QtCore.QVariant(icn.pixmap(20,20))   elif role == QtCore.Qt.FontRole:   if self._fulllist and current_file_desc['infiles']:   font = QtGui.QFont()   font.setBold(True)   return QtCore.QVariant(font)   elif role == QtCore.Qt.ForegroundRole:   color = self._flagcolor.get(current_file_desc['flag'], 'black')   if color is not None:   return QtCore.QVariant(QtGui.QColor(color))   return nullvariant     def headerData(self, section, orientation, role):   if ismerge(self.current_ctx):   if self._fulllist:   header = ('File (all)', 'Diff')   else:   header = ('File (merged only)', 'Diff')   else:   header = ('File', 'Diff')     if orientation == QtCore.Qt.Horizontal and role == QtCore.Qt.DisplayRole:   return QtCore.QVariant(header[section])     return nullvariant        class TreeItem(object):   def __init__(self, data, parent=None):   self.parentItem = parent   self.itemData = data   self.childItems = []     def appendChild(self, item):   self.childItems.append(item)   return item   addChild = appendChild     def child(self, row):   return self.childItems[row]     def childCount(self):   return len(self.childItems)     def columnCount(self):   return len(self.itemData)     def data(self, column):   return self.itemData[column]     def parent(self):   return self.parentItem     def row(self):   if self.parentItem:   return self.parentItem.childItems.index(self)   return 0     def __getitem__(self, idx):   return self.childItems[idx]     def __len__(self):   return len(self.childItems)     def __iter__(self):   for ch in self.childItems:   yield ch      class ManifestModel(QtCore.QAbstractItemModel):   """   Qt model to display a hg manifest, ie. the tree of files at a   given revision. To be used with a QTreeView.   """   def __init__(self, repo, rev, parent=None):   QtCore.QAbstractItemModel.__init__(self, parent)     self.repo = repo   self.changectx = self.repo.changectx(rev)   self.setupModelData()     def data(self, index, role):   if not index.isValid():   return QtCore.QVariant()     if role != QtCore.Qt.DisplayRole:   return QtCore.QVariant()     item = index.internalPointer()   return QtCore.QVariant(item.data(index.column()))     def flags(self, index):   if not index.isValid():   return QtCore.Qt.ItemIsEnabled   return QtCore.Qt.ItemIsEnabled | QtCore.Qt.ItemIsSelectable     def headerData(self, section, orientation, role):   if orientation == QtCore.Qt.Horizontal and role == QtCore.Qt.DisplayRole:   return QtCore.QVariant(self.rootItem.data(section))   return QtCore.QVariant()     def index(self, row, column, parent):   if row < 0 or column < 0 or row >= self.rowCount(parent) or column >= self.columnCount(parent):   return QtCore.QModelIndex()     if not parent.isValid():   parentItem = self.rootItem   else:   parentItem = parent.internalPointer()   childItem = parentItem.child(row)   if childItem is not None:   return self.createIndex(row, column, childItem)   else:   return QtCore.QModelIndex()     def parent(self, index):   if not index.isValid():   return QtCore.QModelIndex()     childItem = index.internalPointer()   parentItem = childItem.parent()     if parentItem == self.rootItem:   return QtCore.QModelIndex()     return self.createIndex(parentItem.row(), 0, parentItem)     def rowCount(self, parent):   if parent.column() > 0:   return 0     if not parent.isValid():   parentItem = self.rootItem   else:   parentItem = parent.internalPointer()   return parentItem.childCount()     def columnCount(self, parent):   if parent.isValid():   return parent.internalPointer().columnCount()   else:   return self.rootItem.columnCount()     def setupModelData(self):   rootData = ["rev %s:%s" % (self.changectx.rev(),   short_hex(self.changectx.node()))]   self.rootItem = TreeItem(rootData)     for path in sorted(self.changectx.manifest()):   path = path.split(osp.sep)   node = self.rootItem     for p in path:   for ch in node:   if ch.data(0) == p:   node = ch   break   else:   node = node.addChild(TreeItem([p], node))     def pathFromIndex(self, index):   idxs = []   while index.isValid():   idxs.insert(0, index)   index = self.parent(index)   return osp.sep.join([index.internalPointer().data(0) for index in idxs])      if __name__ == "__main__":   from mercurial import ui, hg   from optparse import OptionParser   p = OptionParser()   p.add_option('-R', '--root', default='.',   dest='root',   help="Repository main directory")   p.add_option('-f', '--file', default=None,   dest='filename',   help="display the revision graph of this file (if not given, display the whole rev graph)")     opt, args = p.parse_args()     u = ui.ui()   repo = hg.repository(u, opt.root)   app = QtGui.QApplication(sys.argv)   if opt.filename is not None:   model = FileRevModel(repo, opt.filename)   else:   model = HgRepoListModel(repo)     view = QtGui.QTableView()   #delegate = GraphDelegate()   #view.setItemDelegateForColumn(1, delegate)   view.setShowGrid(False)   view.verticalHeader().hide()   view.verticalHeader().setDefaultSectionSize(20)   view.setSelectionMode(QtGui.QAbstractItemView.SingleSelection)   view.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)   view.setModel(model)   view.setWindowTitle("Simple Hg List Model")   view.show()   view.setAlternatingRowColors(True)   #view.resizeColumnsToContents()   sys.exit(app.exec_())
Change 1 of 1 Show Entire File tortoisehg/​hgqt/​hgviewlib/​hgrepoview.py Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/hgrepoview.py
 
34
35
36
37
38
39
 
 
 
40
41
42
 
34
35
36
 
 
 
37
38
39
40
41
42
@@ -34,9 +34,9 @@
   from tortoisehg.hgqt.hgviewlib.decorators import timeit  from tortoisehg.hgqt.hgviewlib.config import HgConfig -from tortoisehg.hgqt.hgviewlib.qt4 import icon as geticon -from tortoisehg.hgqt.hgviewlib.qt4.hgmanifestdialog import ManifestViewer -from tortoisehg.hgqt.hgviewlib.qt4.quickbar import QuickBar +from tortoisehg.hgqt.hgviewlib import icon as geticon +from tortoisehg.hgqt.hgviewlib.hgmanifestdialog import ManifestViewer +from tortoisehg.hgqt.hgviewlib.quickbar import QuickBar    class GotoQuickBar(QuickBar):   def __init__(self, parent):
Change 1 of 2 Show Entire File tortoisehg/​hgqt/​hgviewlib/​hgrepoviewer.py Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/hgrepoviewer.py
 
23
24
25
26
27
28
29
30
31
32
 
 
 
 
 
 
 
33
34
35
 
522
523
524
525
 
526
527
528
 
23
24
25
 
 
 
 
 
 
 
26
27
28
29
30
31
32
33
34
35
 
522
523
524
 
525
526
527
528
@@ -23,13 +23,13 @@
 from tortoisehg.hgqt.hgviewlib.hggraph import diff as revdiff  from tortoisehg.hgqt.hgviewlib.decorators import timeit   -from tortoisehg.hgqt.hgviewlib.qt4 import icon as geticon -from tortoisehg.hgqt.hgviewlib.qt4.hgrepomodel import HgRepoListModel, HgFileListModel -from tortoisehg.hgqt.hgviewlib.qt4.hgfiledialog import FileViewer, FileDiffViewer -from tortoisehg.hgqt.hgviewlib.qt4.hgmanifestdialog import ManifestViewer -from tortoisehg.hgqt.hgviewlib.qt4.hgdialogmixin import HgDialogMixin -from tortoisehg.hgqt.hgviewlib.qt4.quickbar import FindInGraphlogQuickBar -from tortoisehg.hgqt.hgviewlib.qt4.helpviewer import HelpViewer +from tortoisehg.hgqt.hgviewlib import icon as geticon +from tortoisehg.hgqt.hgviewlib.hgrepomodel import HgRepoListModel, HgFileListModel +from tortoisehg.hgqt.hgviewlib.hgfiledialog import FileViewer, FileDiffViewer +from tortoisehg.hgqt.hgviewlib.hgmanifestdialog import ManifestViewer +from tortoisehg.hgqt.hgviewlib.hgdialogmixin import HgDialogMixin +from tortoisehg.hgqt.hgviewlib.quickbar import FindInGraphlogQuickBar +from tortoisehg.hgqt.hgviewlib.helpviewer import HelpViewer    from tortoisehg.util import paths   @@ -522,7 +522,7 @@
  w.activateWindow()    def run(ui, *pats, **opts): - from tortoisehg.hgqt.hgviewlib.qt4 import setup_font_substitutions + from tortoisehg.hgqt.hgviewlib import setup_font_substitutions   setup_font_substitutions()     repo = None
Show Entire File tortoisehg/​hgqt/​hgviewlib/​icons/​README Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/README
(No changes)
Show Entire File tortoisehg/​hgqt/​hgviewlib/​icons/​back.svg Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/back.svg
(No changes)
Show Entire File tortoisehg/​hgqt/​hgviewlib/​icons/​clean.svg Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/clean.svg
(No changes)
tortoisehg/​hgqt/​hgviewlib/​icons/​close.png Side by side
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/close.png
Removed image
Added image
Subtracted image Added image
Show Entire File tortoisehg/​hgqt/​hgviewlib/​icons/​down.svg Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/down.svg
(No changes)
Show Entire File tortoisehg/​hgqt/​hgviewlib/​icons/​find.svg Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/find.svg
(No changes)
Show Entire File tortoisehg/​hgqt/​hgviewlib/​icons/​forward.svg Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/forward.svg
(No changes)
Show Entire File tortoisehg/​hgqt/​hgviewlib/​icons/​goto.svg Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/goto.svg
(No changes)
Show Entire File tortoisehg/​hgqt/​hgviewlib/​icons/​help.svg Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/help.svg
(No changes)
Show Entire File tortoisehg/​hgqt/​hgviewlib/​icons/​left.svg Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/left.svg
(No changes)
Show Entire File tortoisehg/​hgqt/​hgviewlib/​icons/​leftright.svg Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/leftright.svg
(No changes)
Show Entire File tortoisehg/​hgqt/​hgviewlib/​icons/​modified.svg Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/modified.svg
(No changes)
Show Entire File tortoisehg/​hgqt/​hgviewlib/​icons/​mqdiff.svg Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/mqdiff.svg
(No changes)
Show Entire File tortoisehg/​hgqt/​hgviewlib/​icons/​mqdiff_x.svg Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/mqdiff_x.svg
(No changes)
Show Entire File tortoisehg/​hgqt/​hgviewlib/​icons/​mqpatch.svg Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/mqpatch.svg
(No changes)
Show Entire File tortoisehg/​hgqt/​hgviewlib/​icons/​mqpatch_x.svg Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/mqpatch_x.svg
(No changes)
Show Entire File tortoisehg/​hgqt/​hgviewlib/​icons/​quit.svg Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/quit.svg
(No changes)
Show Entire File tortoisehg/​hgqt/​hgviewlib/​icons/​reload.svg Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/reload.svg
(No changes)
Show Entire File tortoisehg/​hgqt/​hgviewlib/​icons/​right.svg Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/right.svg
(No changes)
Show Entire File tortoisehg/​hgqt/​hgviewlib/​icons/​up.svg Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/up.svg
(No changes)
Show Entire File tortoisehg/​hgqt/​hgviewlib/​lexers.py Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/lexers.py
(No changes)
Show Entire File tortoisehg/​hgqt/​hgviewlib/​manifestviewer.ui Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/manifestviewer.ui
(No changes)
Show Entire File tortoisehg/​hgqt/​hgviewlib/​manifestviewer_ui.py Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/manifestviewer_ui.py
(No changes)
Change 1 of 2 Show Entire File tortoisehg/​hgqt/​hgviewlib/​quickbar.py Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/quickbar.py
 
23
24
25
26
 
27
28
29
 
318
319
320
321
 
322
323
324
 
23
24
25
 
26
27
28
29
 
318
319
320
 
321
322
323
324
@@ -23,7 +23,7 @@
   from tortoisehg.util.util import Curry   -from tortoisehg.hgqt.hgviewlib.qt4 import icon as geticon +from tortoisehg.hgqt.hgviewlib import icon as geticon    Qt = QtCore.Qt  connect = QtCore.QObject.connect @@ -318,7 +318,7 @@
   if __name__ == "__main__":   import sys - import hgviewlib.qt4 # to force importation of resource module w/ icons + import hgviewlib # to force importation of resource module w/ icons   app = QtGui.QApplication(sys.argv)   root = QtGui.QMainWindow()   w = QtGui.QFrame()
 
361
362
363
364
 
365
366
367
 
361
362
363
 
364
365
366
367
@@ -361,7 +361,7 @@
   def log(ui, *pats, **opts):   """Repository Explorer (changelog viewer)""" - from tortoisehg.hgqt.hgviewlib.qt4.hgrepoviewer import run + from tortoisehg.hgqt.hgviewlib.hgrepoviewer import run   qtrun(run, ui, *pats, **opts)    ### help management, adapted from mercurial.commands.help_()