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

grep: implement 'view changeset' option

This feature will only work within the workbench, where a signal can
be forwarded to the repoview to jump to a particular revision.

Changeset 77b90c283b18

Parent 2a5f049507d8

by Steve Borho

Changes to 2 files · Browse files at 77b90c283b18 Showing diff from parent 2a5f049507d8 Diff from another changeset...

 
24
25
26
 
27
28
29
 
124
125
126
 
127
128
129
 
440
441
442
 
443
444
445
 
451
452
453
 
454
455
456
 
516
517
518
519
 
520
521
522
 
549
550
551
552
 
 
 
553
554
555
 
24
25
26
27
28
29
30
 
125
126
127
128
129
130
131
 
442
443
444
445
446
447
448
 
454
455
456
457
458
459
460
 
520
521
522
 
523
524
525
526
 
553
554
555
 
556
557
558
559
560
561
@@ -24,6 +24,7 @@
  '''Working copy and repository search widget'''   showMessage = pyqtSignal(QString)   progress = pyqtSignal(QString, object, QString, QString, object) + revisionSelected = pyqtSignal(int)     def __init__(self, upats, repo, parent=None, **opts):   QWidget.__init__(self, parent) @@ -124,6 +125,7 @@
  tv = MatchTree(repo, self)   tm = MatchModel(self)   tv.setModel(tm) + tv.revisionSelected.connect(self.revisionSelected)   tv.setColumnHidden(COL_REVISION, True)   tv.setColumnHidden(COL_USER, True)   mainvbox.addWidget(tv) @@ -440,6 +442,7 @@
 COL_TEXT = 4    class MatchTree(QTableView): + revisionSelected = pyqtSignal(int)   contextmenu = None     def __init__(self, repo, parent): @@ -451,6 +454,7 @@
  self.setSelectionBehavior(QAbstractItemView.SelectRows)   self.setContextMenuPolicy(Qt.CustomContextMenu)   self.setShowGrid(False) + self.embedded = parent.parent() is not None   vh = self.verticalHeader()   vh.hide()   vh.setDefaultSectionSize(20) @@ -516,7 +520,7 @@
  return   point = self.mapToGlobal(point)   menus = [(_('View file'), self.view), (_('Annotate file'), self.ann)] - if not wctxonly: + if not wctxonly and self.embedded:   menus.append((_('View Changeset'), self.ctx))   if allhistory:   # need to know files were modified at specified revision @@ -549,7 +553,9 @@
  dlg.show()     def ctx(self, rows): - raise NotImplementedError() + for rev, path, line in rows: + self.revisionSelected.emit(int(rev)) + return     def view(self, rows):   from tortoisehg.hgqt import wctxactions
 
361
362
363
 
364
365
366
 
361
362
363
364
365
366
367
@@ -361,6 +361,7 @@
  gw.setRevision(self.repoview.current_rev)   gw.showMessage.connect(self.showMessage)   gw.progress.connect(self.progress) + gw.revisionSelected.connect(self.goto)   return gw     def createPatchBranchWidget(self):