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

annotate: add menu options for annotating/editing parent revision

for viewing the file as it was just before the selected line was added.

Note that fctx.linkrev()-1 is not iron-clad. There could be a rename at
that changeset to throw a monkey wrench into the works.

Changeset df51f9db28fa

Parent 39c9013ca46e

by Steve Borho

Changes to one file · Browse files at df51f9db28fa Showing diff from parent 39c9013ca46e Diff from another changeset...

 
97
98
99
100
 
101
102
 
103
104
105
106
 
 
107
108
109
 
 
 
 
 
 
 
 
 
 
 
110
111
112
 
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
@@ -97,16 +97,27 @@
  point = self.mapToGlobal(point)   fctx, line = self.links[line.blockNumber()]   data = [fctx.path(), fctx.linkrev(), line] - def annparent(): + def annorig():   self.emit(SIGNAL('revSelected'), data) - def editparent(): + def editorig():   self.emit(SIGNAL('editSelected'), data)   menu = QMenu(self) - for name, func in [(_('Annotate originating revision'), annparent), - (_('View originating revision'), editparent)]: + for name, func in [(_('Annotate originating revision'), annorig), + (_('View originating revision'), editorig)]:   action = menu.addAction(name)   action.wrapper = lambda f=func: f()   self.connect(action, SIGNAL('triggered()'), action.wrapper) + if fctx.linkrev() > 0: + data2 = [fctx.path(), fctx.linkrev()-1, line] + def annparent(): + self.emit(SIGNAL('revSelected'), data2) + def editparent(): + self.emit(SIGNAL('editSelected'), data2) + for name, func in [(_('Annotate parent revision'), annparent), + (_('View parent revision'), editparent)]: + action = menu.addAction(name) + action.wrapper = lambda f=func: f() + self.connect(action, SIGNAL('triggered()'), action.wrapper)   menu.exec_(point)     def __init__(self, parent=None):