Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in tip

fogcreek Merge with stable

Changeset eacaa46c6eae

Parents 0524579d8c04

Parents 49d1b27ed01a

by David Golub

Changes to 11 files · Browse files at eacaa46c6eae Showing diff from parent 0524579d8c04 49d1b27ed01a Diff from another changeset...

 
282
283
284
285
286
287
288
 
320
321
322
 
323
324
325
 
459
460
461
 
 
462
463
464
 
659
660
661
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
282
283
284
 
285
286
287
 
319
320
321
322
323
324
325
 
459
460
461
462
463
464
465
466
 
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
@@ -282,7 +282,6 @@
  for filename in filenames]   qtlib.editfiles(self.repo, files, parent=self)   -   @pyqtSlot(QString)   def onLinkActivated(self, link):   link = unicode(link) @@ -320,6 +319,7 @@
  def __init__(self, repo, filename, repoviewer=None):   super(FileDiffDialog, self).__init__(repo, filename, repoviewer)   self._readSettings() + self.menu = None     def closeEvent(self, event):   self._writeSettings() @@ -459,6 +459,8 @@
  self.filerevmodel.filled.connect(self.modelFilled)   self.tableView_revisions_left.setModel(self.filerevmodel)   self.tableView_revisions_right.setModel(self.filerevmodel) + self.tableView_revisions_left.menuRequested.connect(self.viewMenuRequest) + self.tableView_revisions_right.menuRequested.connect(self.viewMenuRequest)     def createActions(self):   self.actionClose.triggered.connect(self.close) @@ -659,3 +661,99 @@
  self.tableView_revisions_left.saveSettings()   self.tableView_revisions_right.saveSettings()   super(FileDiffDialog, self).reload() + + @pyqtSlot(QPoint, object) + def viewMenuRequest(self, point, selection): + 'User requested a context menu in repo view widget' + if not selection: + return + if self.menu is None: + self.menu = menu = QMenu(self) + a = menu.addAction(_('Visual diff...')) + a.setIcon(qtlib.getmenuicon('visualdiff')) + a.triggered.connect(self.onVisualDiff) + a = menu.addAction(_('Diff to local...')) + a.setIcon(qtlib.getmenuicon('ldiff')) + a.triggered.connect(self.onVisualDiffToLocal) + menu.addSeparator() + a = menu.addAction(_('Visual diff file...')) + a.setIcon(qtlib.getmenuicon('visualdiff')) + a.triggered.connect(self.onVisualDiffFile) + a = menu.addAction(_('Diff file to local...')) + a.setIcon(qtlib.getmenuicon('ldiff')) + a.triggered.connect(self.onVisualDiffFileToLocal) + menu.addSeparator() + a = menu.addAction(_('View at revision...')) + a.setIcon(qtlib.getmenuicon('view-at-revision')) + a.triggered.connect(self.onViewFileAtRevision) + a = menu.addAction(_('Edit local')) + a.setIcon(qtlib.getmenuicon('edit-file')) + a.triggered.connect(self.onEditLocal) + a = menu.addAction(_('Revert to revision...')) + a.setIcon(qtlib.getmenuicon('hg-revert')) + a.triggered.connect(self.onRevertFileToRevision) + self.selection = selection + self.menu.exec_(point) + + def onVisualDiff(self): + opts = dict(change=self.selection[0]) + dlg = visdiff.visualdiff(self.repo.ui, self.repo, [], opts) + if dlg: + dlg.exec_() + dlg.deleteLater() + + def onVisualDiffToLocal(self): + opts = dict(rev=['rev(%d)' % self.selection[0]]) + dlg = visdiff.visualdiff(self.repo.ui, self.repo, [], opts) + if dlg: + dlg.exec_() + dlg.deleteLater() + + def onVisualDiffFile(self): + rev = self.selection[0] + paths = [self.filerevmodel.graph.filename(rev)] + opts = dict(change=self.selection[0]) + dlg = visdiff.visualdiff(self.repo.ui, self.repo, paths, opts) + if dlg: + dlg.exec_() + dlg.deleteLater() + + def onVisualDiffFileToLocal(self): + rev = self.selection[0] + paths = [self.filerevmodel.graph.filename(rev)] + opts = dict(rev=['rev(%d)' % rev]) + dlg = visdiff.visualdiff(self.repo.ui, self.repo, paths, opts) + if dlg: + dlg.exec_() + dlg.deleteLater() + + def onEditLocal(self): + filenames = [self.filename] + if not filenames: + return + qtlib.editfiles(self.repo, filenames, parent=self) + + def onRevertFileToRevision(self): + rev = self.selection[0] + if rev is None: + rev = self.repo['.'].rev() + fileSelection = [self.filerevmodel.graph.filename(rev)] + if len(fileSelection) == 0: + return + dlg = revert.RevertDialog(self.repo, fileSelection, rev, self) + if dlg: + dlg.exec_() + dlg.deleteLater() + + def onViewFileAtRevision(self): + rev = self.selection[0] + filenames = [self.filerevmodel.graph.filename(rev)] + if not filenames: + return + if rev is None: + qtlib.editfiles(self.repo, filenames, parent=self) + else: + base, _ = visdiff.snapshot(self.repo, filenames, self.repo[rev]) + files = [os.path.join(base, filename) + for filename in filenames] + qtlib.editfiles(self.repo, files, parent=self)
 
682
683
684
685
 
 
 
 
686
687
688
 
682
683
684
 
685
686
687
688
689
690
691
@@ -682,7 +682,10 @@
  if ctx.rev() is None:   return   wsub, filename, ctx = hglib.getDeepestSubrepoContainingFile(filename, ctx) - assert filename in ctx + if wsub is None: + # The file was not found in the repo context or its subrepos + # This may happen for files that have been removed + return   self.ctx = ctx   self.annfile = filename   self._thread.abort()
 
244
245
246
247
248
 
 
249
250
251
 
244
245
246
 
 
247
248
249
250
251
@@ -244,8 +244,8 @@
  for branch in branches:   self._branchCombo.addItem(branch)   self._branchCombo.setItemData(self._branchCombo.count() - 1, branch, Qt.ToolTipRole) - self._branchLabel.setEnabled(self.filterEnabled and len(branches) > 1) - self._branchCombo.setEnabled(self.filterEnabled and len(branches) > 1) + self._branchLabel.setEnabled(self.filterEnabled and (len(branches) > 1 or self._abranchAction.isChecked())) + self._branchCombo.setEnabled(self.filterEnabled and (len(branches) > 1 or self._abranchAction.isChecked()))   self._branchReloading = False     if not curbranch:
 
296
297
298
299
 
300
301
302
 
296
297
298
 
299
300
301
302
@@ -296,7 +296,7 @@
  def dropAccepted(self):   # Whenever a drag and drop operation is completed, update the settings   # file - self.updateSettingsFile() + QTimer.singleShot(0, self.updateSettingsFile)     @pyqtSlot(QString)   def modifiedSettings(self):
 
79
80
81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
83
84
85
 
86
87
88
 
97
98
99
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
101
102
 
1522
1523
1524
1525
 
1526
1527
1528
 
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
 
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
 
1567
1568
1569
 
1570
1571
1572
1573
@@ -79,10 +79,31 @@
  self.basenode = None   self.destroyed.connect(self.repo.thginvalidate)   + # Determine the "initial revision" that must be shown when + # opening the repo. + # The "initial revision" can be selected via the settings, and it can + # have 3 possible values: + # - "current": Select the current (i.e. working dir parent) revision + # - "tip": Select tip of the repository + # - "workingdir": Select the working directory pseudo-revision + initialRevision= \ + self.repo.ui.config('tortoisehg', 'initialrevision', 'current').lower() + + initialRevisionDict = { + 'current': '.', + 'tip': 'tip', + 'workingdir': None + } + if initialRevision in initialRevisionDict: + default_rev = initialRevisionDict[initialRevision] + else: + # By default we'll select the current (i.e. working dir parent) revision + default_rev = '.' +   if repo.parents()[0].rev() == -1:   self._reload_rev = 'tip'   else: - self._reload_rev = '.' + self._reload_rev = default_rev   self.currentMessage = ''   self.dirty = False   @@ -97,6 +118,30 @@
  self.runner.makeLogVisible.connect(self.makeLogVisible)   self.runner.commandFinished.connect(self.onCommandFinished)   + # Select the widget chosen by the user + defaultWidget = \ + self.repo.ui.config( + 'tortoisehg', 'defaultwidget', 'revdetails').lower() + widgetDict = { + 'revdetails': self.logTabIndex, + 'commit': self.commitTabIndex, + 'mq': self.mqTabIndex, + 'sync': self.syncTabIndex, + 'manifest': self.manifestTabIndex, + 'search': self.grepTabIndex + } + if initialRevision == 'workingdir': + # Do not allow selecting the revision details widget when the + # selected revision is the working directory pseudo-revision + widgetDict['revdetails'] = self.commitTabIndex + + if defaultWidget in widgetDict: + widgetIndex = widgetDict[defaultWidget] + # Note: if the mq extension is not enabled, self.mqTabIndex will + # be negative + if widgetIndex > 0: + self.taskTabsWidget.setCurrentIndex(widgetIndex) +   def setupUi(self):   SP = QSizePolicy   @@ -1522,7 +1567,7 @@
    def bundleRevisions(self, base=None, tip=None):   root = self.repo.root - if not base: + if base is None or base is False:   base = self.rev   data = dict(name=os.path.basename(root), base=base)   if tip is None:
 
58
59
60
 
 
61
62
63
 
58
59
60
61
62
63
64
65
@@ -58,6 +58,8 @@
  self.grid.addWidget(pcombo, 0, 1)     ### Options + self.discard_chk.setText(_('Discard remote changes, no backup ' + '(-C/--clean)'))   self.push_chk = QCheckBox(_('Perform a push before updating'   ' (-p/--push)'))   self.newbranch_chk = QCheckBox(_('Allow pushing new branches'
 
410
411
412
 
 
 
 
 
 
 
 
 
 
 
413
414
415
 
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
@@ -410,6 +410,17 @@
  )),    ({'name': 'log', 'label': _('Workbench'), 'icon': 'menulog'}, ( + _fi(_('Default widget'), 'tortoisehg.defaultwidget', (genDefaultCombo, + ['revdetails', 'commit', 'mq', 'sync', 'manifest', 'search']), + _('Select the initial widget that will be shown when opening a ' + 'repository. ' + 'Default: revdetails')), + _fi(_('Initial revision'), 'tortoisehg.initialrevision', (genDefaultCombo, + ['current', 'tip', 'workingdir']), + _('Select the initial revision that will be selected when opening a ' + 'repository. You can select the "current" (i.e. the working directory ' + 'parent), the current "tip" or the working directory ("workingdir"). ' + 'Default: current')),   _fi(_('Author Coloring'), 'tortoisehg.authorcolor', genBoolCombo,   _('Color changesets by author name. If not enabled, '   'the changes are colored green for merge, red for '
 
405
406
407
408
 
409
410
411
412
413
414
415
 
416
417
 
418
419
420
 
426
427
428
429
 
430
431
 
432
433
434
435
 
 
436
437
 
438
439
440
 
465
466
467
468
469
470
471
 
473
474
475
476
477
478
479
480
481
482
483
484
485
486
 
405
406
407
 
408
409
410
411
412
413
414
 
415
416
 
417
418
419
420
 
426
427
428
 
429
430
 
431
432
433
 
 
434
435
436
 
437
438
439
440
 
465
466
467
 
468
469
470
 
472
473
474
 
 
 
 
 
 
 
 
475
476
477
@@ -405,16 +405,16 @@
  stopts = extract(('unknown', 'ignored', 'clean'), self.opts)   patchecked = {}   try: - if self.pats: + if self.pats:   if self.opts.get('checkall'):   # quickop sets this flag to pre-check even !?IC files   precheckfn = lambda x: True   else:   # status and commit only pre-check MAR files   precheckfn = lambda x: x < 4 - m = hglib.match(self.repo[None], self.pats) + m = hglib.match(self.repo[None], self.pats)   self.repo.bfstatus = True - status = self.repo.status(match=m, **stopts) + status = self.repo.status(match=m, **stopts)   self.repo.bfstatus = False   # Record all matched files as initially checked   for i, stat in enumerate(StatusType.preferredOrder): @@ -426,15 +426,15 @@
  patchecked.update(d)   wctx = context.workingctx(self.repo, changes=status)   self.patchecked = patchecked - elif self.pctx: + elif self.pctx:   self.repo.bfstatus = True - status = self.repo.status(node1=self.pctx.p1().node(), **stopts) + status = self.repo.status(node1=self.pctx.p1().node(), **stopts)   self.repo.bfstatus = False   wctx = context.workingctx(self.repo, changes=status) - else: - wctx = self.repo[None] + else: + wctx = self.repo[None]   self.repo.bfstatus = True - wctx.status(**stopts) + wctx.status(**stopts)   self.repo.bfstatus = False   self.wctx = wctx   @@ -465,7 +465,6 @@
  self.setContextMenuPolicy(Qt.CustomContextMenu)   self.customContextMenuRequested.connect(self.menuRequested)   self.setTextElideMode(Qt.ElideLeft) - self.doubleClicked.connect(self.onDoubleClick)     def scrollTo(self, index, hint=QAbstractItemView.EnsureVisible):   # don't update horizontal position by selection change @@ -473,14 +472,6 @@
  super(WctxFileTree, self).scrollTo(index, hint)   self.horizontalScrollBar().setValue(orighoriz)   - def onDoubleClick(self, index): - if not index.isValid(): - return - path = self.model().getRow(index)[COL_PATH] - dlg = visdiff.visualdiff(self.repo.ui, self.repo, [path], {}) - if dlg: - dlg.exec_() -   def keyPressEvent(self, event):   if event.key() == 32:   self.model().toggleRows(self.selectedRows())
 
15
16
17
18
 
19
20
21
22
23
24
25
 
26
27
28
 
 
29
30
31
 
32
33
34
 
15
16
17
 
18
19
20
21
22
23
24
 
25
26
 
 
27
28
29
30
 
31
32
33
34
@@ -15,20 +15,20 @@
  <?define doc.style.css = {F42E2E5F-6329-4269-B6D8-805C6CFD8D5E} ?>     <!-- help.wxs --> - <?define helpFolder.guid = {4B71277D-72E9-48F2-8A06-C706E9C3B4C0} ?> + <?define helpFolder.guid = {0CD881E3-815A-4227-9F7C-B9D70C1191EF} ?>     <!-- i18n.wxs -->   <?define i18nFolder.guid = {5191051C-742F-470E-AD76-D83C2F1EDE4E} ?>     <!-- templates.wxs -->   <?define templates.root.guid = {6A82D0BF-6878-42F3-92FD-AB39F7A97EEF} ?> - <?define templates.atom.guid = {602F0A54-F5AF-4D22-A2FE-80A188531D02} ?> + <?define templates.atom.guid = {68D030FA-56A1-4CAF-ADBF-07362B1DDF15} ?>   <?define templates.coal.guid = {89768AB3-A942-470B-8C1C-9C026B80FF8E} ?> - <?define templates.gitweb.guid = {66F4305F-8AC6-4B55-AC24-30FFC3161EF0} ?> - <?define templates.monoblue.guid = {F1CC0065-B3D2-4D4C-BD7F-EFDBB4B47CBB} ?> + <?define templates.gitweb.guid = {516A9A5F-33DF-41EC-B64C-F910251549D7} ?> + <?define templates.monoblue.guid = {BF01AC59-C62C-4946-B820-E528748EB3B2} ?>   <?define templates.paper.guid = {31BF16C5-3525-47F7-9733-F67A3B02171B} ?>   <?define templates.raw.guid = {936139F7-9A73-4685-80D2-F17A2BC42EAD} ?> - <?define templates.rss.guid = {891DA56F-B02B-456F-8471-FE47024051E7} ?> + <?define templates.rss.guid = {948BDACE-4E70-459A-BDD2-89158FD53F1F} ?>   <?define templates.spartan.guid = {C49A4A44-53EB-4C37-AA0B-159070F46E84} ?>   <?define templates.static.guid = {B6C414E5-CD1E-4820-86E7-EEC2386426BE} ?>  
 
13
14
15
 
16
 
17
18
19
 
13
14
15
16
17
18
19
20
21
@@ -13,7 +13,9 @@
  <File Name="diffs.txt" />   <File Name="environment.txt" />   <File Name="extensions.txt" /> + <File Name="filesets.txt" />   <File Name="glossary.txt" /> + <File Name="hgignore.txt" />   <File Name="hgweb.txt" />   <File Name="merge-tools.txt" />   <File Name="multirevs.txt" />
 
45
46
47
 
 
48
49
50
 
58
59
60
 
61
62
63
 
85
86
87
 
88
89
90
 
161
162
163
 
 
164
165
166
 
45
46
47
48
49
50
51
52
 
60
61
62
63
64
65
66
 
88
89
90
91
92
93
94
 
165
166
167
168
169
170
171
172
@@ -45,6 +45,8 @@
  <File Id="atom.map" Name="map" />   <File Id="atom.tagentry.tmpl" Name="tagentry.tmpl" />   <File Id="atom.tags.tmpl" Name="tags.tmpl" /> + <File Id="atom.bookmarks.tmpl" Name="bookmarks.tmpl" /> + <File Id="atom.bookmarkentry.tmpl" Name="bookmarkentry.tmpl" />   </Component>   </Directory>   @@ -58,6 +60,7 @@
  <Directory Id="templates.gitwebdir" Name="gitweb">   <Component Id="templates.gitweb" Guid="$(var.templates.gitweb.guid)" Win64='$(var.IsX64)'>   <File Id="gitweb.branches.tmpl" Name="branches.tmpl" KeyPath="yes" /> + <File Id="gitweb.bookmarks.tmpl" Name="bookmarks.tmpl" />   <File Id="gitweb.changelog.tmpl" Name="changelog.tmpl" />   <File Id="gitweb.changelogentry.tmpl" Name="changelogentry.tmpl" />   <File Id="gitweb.changeset.tmpl" Name="changeset.tmpl" /> @@ -85,6 +88,7 @@
  <Directory Id="templates.monobluedir" Name="monoblue">   <Component Id="templates.monoblue" Guid="$(var.templates.monoblue.guid)" Win64='$(var.IsX64)'>   <File Id="monoblue.branches.tmpl" Name="branches.tmpl" KeyPath="yes" /> + <File Id="monoblue.bookmarks.tmpl" Name="bookmarks.tmpl" />   <File Id="monoblue.changelog.tmpl" Name="changelog.tmpl" />   <File Id="monoblue.changelogentry.tmpl" Name="changelogentry.tmpl" />   <File Id="monoblue.changeset.tmpl" Name="changeset.tmpl" /> @@ -161,6 +165,8 @@
  <File Id="rss.map" Name="map" />   <File Id="rss.tagentry.tmpl" Name="tagentry.tmpl" />   <File Id="rss.tags.tmpl" Name="tags.tmpl" /> + <File Id="rss.bookmarks.tmpl" Name="bookmarks.tmpl" /> + <File Id="rss.bookmarkentry.tmpl" Name="bookmarkentry.tmpl" />   </Component>   </Directory>