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

thgpbranch: Add support for updating to patch

Changeset d5785c1518ea

Parent e6d44fe4e3ca

by Peer Sommerlund

Changes to 2 files · Browse files at d5785c1518ea Showing diff from parent e6d44fe4e3ca Diff from another changeset...

 
1002
1003
1004
 
 
 
 
1005
1006
1007
 
1544
1545
1546
1547
 
1548
1549
1550
 
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
 
1548
1549
1550
 
1551
1552
1553
1554
@@ -1002,6 +1002,10 @@
  if hasattr(self, 'mqwidget'):   self.mqwidget.refresh()   + # refresh pbranch widget if exists + if hasattr(self, 'pbranchwidget'): + self.pbranchwidget.refresh() +   # force a redraw of the visible rows   self.graphview.hide()   self.graphview.show() @@ -1544,7 +1548,7 @@
  if 'pbranch' in self.exs:   # create PBranchWidget   self.pbranchwidget = thgpbranch.PBranchWidget( - self.repo, self.stbar, accelgroup, self.tooltips) + self, self.repo, self.stbar, accelgroup, self.tooltips)   self.pbranchwidget.connect('repo-invalidated', self.repo_invalidated)     def wrapframe(widget):
 
8
9
10
11
 
12
13
14
 
15
16
17
 
51
52
53
54
 
55
56
 
57
58
59
 
117
118
119
 
120
121
122
 
491
492
493
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
494
495
496
 
539
540
541
542
 
543
544
545
 
577
578
579
580
 
581
582
583
 
8
9
10
 
11
12
13
14
15
16
17
18
 
52
53
54
 
55
56
57
58
59
60
61
 
119
120
121
122
123
124
125
 
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
 
570
571
572
 
573
574
575
576
 
608
609
610
 
611
612
613
614
@@ -8,10 +8,11 @@
 import gtk  import gobject   -from mercurial import extensions +from mercurial import cmdutil, extensions    from tortoisehg.util.i18n import _   +from tortoisehg.hgtk import update  from tortoisehg.hgtk import gtklib, dialog  from tortoisehg.hgtk.logview import graphcell   @@ -51,9 +52,10 @@
  ()),   }   - def __init__(self, repo, statusbar, accelgroup=None, tooltips=None): + def __init__(self, parentwin, repo, statusbar, accelgroup=None, tooltips=None):   gtk.VBox.__init__(self)   + self.parent_window = parentwin   self.repo = repo   self.pbranch = extensions.find('pbranch')   self.statusbar = statusbar @@ -117,6 +119,7 @@
  #### patch list view   self.list = gtk.TreeView(self.model)   self.list.connect('button-press-event', self.list_pressed) + self.list.connect('row-activated', self.list_row_activated)   self.list.connect('size-allocate', self.list_size_allocated)     #### patch list columns @@ -491,6 +494,34 @@
  menu.show_all()   return menu   + def show_dialog(self, dlg): + """Show modal dialog and block application + See also show_dialog in history.py + """ + dlg.set_transient_for(self.parent_window) + dlg.show_all() + dlg.run() + if gtk.pygtk_version < (2, 12, 0): + # Workaround for old PyGTK (< 2.12.0) issue. + # See background of this: f668034aeda3 + dlg.set_transient_for(None) + + + def update_by_row(self, row): + branch = row[M_NAME] + rev = cmdutil.revrange(self.repo, [branch]) + parents = [x.node() for x in self.repo.parents()] + dialog = update.UpdateDialog(rev[0]) + self.show_dialog(dialog) + self.update_completed(parents) + + def update_completed(self, oldparents): + self.repo.invalidate() + self.repo.dirstate.invalidate() + newparents = [x.node() for x in self.repo.parents()] + if not oldparents == newparents: + self.emit('repo-invalidated') +   def do_get_property(self, property):   try:   return self.vmenu[property.name].get_active() @@ -539,7 +570,7 @@
  self.emit('patch-selected', revid, patchname)     def list_row_activated(self, list, path, column): - self.qgoto_by_row(self.model[path]) + self.update_by_row(self.model[path])     def list_size_allocated(self, list, req):   if self.has_patch(): @@ -577,7 +608,7 @@
  pass     def goto_activated(self, menuitem, row): - assert False + self.update_by_row(row)     def delete_activated(self, menuitem, row):   assert False