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

annotate: use fctx.parents() to generate context menus

Changeset 28e40cf47e7f

Parent b1c4ed211c54

by Steve Borho

Changes to one file · Browse files at 28e40cf47e7f Showing diff from parent b1c4ed211c54 Diff from another changeset...

 
143
144
145
146
147
148
149
 
 
 
 
150
151
152
153
 
 
 
 
 
154
155
 
156
157
158
 
143
144
145
 
 
 
 
146
147
148
149
150
 
 
 
151
152
153
154
155
156
 
157
158
159
160
@@ -143,16 +143,18 @@
  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) + for pfctx in fctx.parents(): + pdata = [pfctx.path(), pfctx.changectx().rev(), line] + def annparent(data): + self.emit(SIGNAL('revSelected'), data)   def editparent(): - self.emit(SIGNAL('editSelected'), data2) - for name, func in [(_('Annotate parent revision'), annparent), - (_('View parent revision'), editparent)]: + self.emit(SIGNAL('editSelected'), data) + for name, func in [(_('Annotate parent revision %d') % pdata[1], + annparent), + (_('View parent revision %d') % pdata[1], + editparent)]:   action = menu.addAction(name) - action.wrapper = lambda f=func: f() + action.wrapper = lambda f=func,d=pdata: f(d)   self.connect(action, SIGNAL('triggered()'), action.wrapper)   menu.exec_(point)