Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.1, 1.1.1, and 1.1.2

thgpbranch: Make context menu sensitive to patch state

Changeset 1c9d9c60c4b8

Parent eff49c47d228

by Peer Sommerlund

Changes to one file · Browse files at 1c9d9c60c4b8 Showing diff from parent eff49c47d228 Diff from another changeset...

 
116
117
118
 
119
120
121
 
352
353
354
 
355
356
357
 
358
359
360
 
423
424
425
426
427
 
 
 
428
429
430
431
 
 
 
 
 
 
 
432
433
434
 
564
565
566
567
 
 
 
 
 
 
 
 
 
 
 
 
116
117
118
119
120
121
122
 
353
354
355
356
357
358
359
360
361
362
363
 
426
427
428
 
 
429
430
431
432
 
 
 
433
434
435
436
437
438
439
440
441
442
 
572
573
574
 
 
575
576
577
578
579
580
581
582
583
584
@@ -116,6 +116,7 @@
  str) # patch name   #### patch list view   self.list = gtk.TreeView(self.model) + self.list.connect('button-press-event', self.list_pressed)   self.list.connect('size-allocate', self.list_size_allocated)     #### patch list columns @@ -352,9 +353,11 @@
  assert False     def has_pbranch(self): + """ return True if pbranch extension can be used """   return self.pbranch is not None     def has_patch(self): + """ return True if pbranch extension is in use on repo """   return self.has_pbranch() and self.pgraph() != []     def cur_patch(self): @@ -423,12 +426,17 @@
  item.connect('activate', handler, row)   menu.append(item)   - is_operable = self.is_operable() - has_patch = self.has_patch() + has_pbranch = self.has_pbranch() + is_current = self.has_patch() and self.cur_patch() == row[M_NAME] + is_patch = row[M_NAME] != 'default'   - append(_('_goto (update workdir)'), self.update_activated) - append(_('_rename'), self.rename_activated) - append(_('_delete'), self.delete_activated) + if has_pbranch: + append(_('_new'), self.pnew_activated) + if not is_current: + append(_('_goto (update workdir)'), self.goto_activated) + if is_patch: + append(_('_rename'), self.rename_activated) + append(_('_delete'), self.delete_activated)     if len(menu.get_children()) > 0:   menu.show_all() @@ -564,4 +572,13 @@
  # Update to row[M_NAME]   # pnew_ui   # if aborted, update back to prev branch - pass \ No newline at end of file
+ pass + + def goto_activated(self, menuitem, row): + assert False + + def delete_activated(self, menuitem, row): + assert False + + def rename_activated(self, menuitem, row): + assert False