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 line and pattern arguments

prep work for integrating the grep and annotate dialogs

Changeset 273eb09e5f8c

Parent f4f8be07a223

by Steve Borho

Changes to 2 files · Browse files at 273eb09e5f8c Showing diff from parent f4f8be07a223 Diff from another changeset...

 
276
277
278
 
279
280
281
 
301
302
303
 
 
 
304
305
306
307
308
309
310
 
311
312
313
 
371
372
373
374
 
 
276
277
278
279
280
281
282
 
302
303
304
305
306
307
308
309
310
311
312
313
 
314
315
316
317
 
375
376
377
 
378
@@ -276,6 +276,7 @@
  hbox.setMargin(0)   lbl = QLabel(_('Regexp:'))   le = QLineEdit() + le.setText(hglib.tounicode(opts.get('pattern', '')))   lbl.setBuddy(le)   lbl.setToolTip(_('Regular expression search pattern'))   bt = QPushButton(_('Search')) @@ -301,13 +302,16 @@
  self.status = status     self.opts = opts + line = opts.get('line') + if line and isinstance(line, str): + line = int(line)   try:   repo = hg.repository(ui.ui(), path=paths.find_root())   ctx = repo[opts.get('rev', '.')]   fctx = ctx[pats[0]] # just for validation   except Exception, e:   self.status.setText(hglib.tounicode(str(e))) - av.annotateFileAtRev(repo, ctx, pats[0]) + av.annotateFileAtRev(repo, ctx, pats[0], line)   self.setWindowTitle(_('Annotate %s@%d') % (pats[0], ctx.rev()))   self.repo = repo   @@ -371,4 +375,4 @@
  super(AnnotateDialog, self).reject()    def run(ui, *pats, **opts): - return AnnotateDialog(*pats) + return AnnotateDialog(*pats, **opts)
 
671
672
673
674
 
 
 
675
676
677
 
671
672
673
 
674
675
676
677
678
679
@@ -671,7 +671,9 @@
  "about": (about, [], _('thg about')),   "add": (add, [], _('thg add [FILE]...')),   "^annotate|blame": (annotate, - [('r', 'rev', '', _('revision to annotate'))], + [('r', 'rev', '', _('revision to annotate')), + ('n', 'line', '', _('open to line')), + ('p', 'pattern', '', _('initial search pattern'))],   _('thg annotate')),   "archive": (archive,   [('r', 'rev', '', _('revision to archive'))],