bzr branch
http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz
| 
1
by Scott James Remnant
 Commit the first version of bzrk.  | 
1  | 
# -*- coding: UTF-8 -*-
 | 
2  | 
"""Branch window.
 | 
|
3  | 
||
4  | 
This module contains the code to manage the branch information window,
 | 
|
5  | 
which contains both the revision graph and details panes.
 | 
|
6  | 
"""
 | 
|
7  | 
||
8  | 
__copyright__ = "Copyright © 2005 Canonical Ltd."  | 
|
9  | 
__author__ = "Scott James Remnant <scott@ubuntu.com>"  | 
|
10  | 
||
11  | 
||
12  | 
import gtk  | 
|
13  | 
import gobject  | 
|
14  | 
import pango  | 
|
15  | 
||
| 
298.2.1
by Daniel Schierbeck
 Refactored the GTK window code, creating a single base window class that handles keyboard events.  | 
16  | 
from bzrlib.plugins.gtk.window import Window  | 
| 
450.4.1
by Daniel Schierbeck
 Added tag icon to branch history window.  | 
17  | 
from bzrlib.plugins.gtk import icon_path  | 
| 
365
by Daniel Schierbeck
 Fixed locks and made tagging work.  | 
18  | 
from bzrlib.plugins.gtk.tags import AddTagDialog  | 
| 
338
by Daniel Schierbeck
 Added Preferences menu item.  | 
19  | 
from bzrlib.plugins.gtk.preferences import PreferencesWindow  | 
| 
423.1.17
by Gary van der Merwe
 Reuse the viz treeview in the revision browser.  | 
20  | 
from bzrlib.plugins.gtk.branchview import TreeView, treemodel  | 
| 
511.6.1
by Jelmer Vernooij
 Add Branch/Index option if bzr-search is available.  | 
21  | 
|
22  | 
from bzrlib.config import BranchConfig, GlobalConfig  | 
|
| 
443
by Szilveszter Farkas (Phanatic)
 Trivial fix for #149061 (be able to show the diff for revision 1).  | 
23  | 
from bzrlib.revision import Revision, NULL_REVISION  | 
| 
511.6.1
by Jelmer Vernooij
 Add Branch/Index option if bzr-search is available.  | 
24  | 
from bzrlib.trace import mutter  | 
| 
1
by Scott James Remnant
 Commit the first version of bzrk.  | 
25  | 
|
| 
298.2.1
by Daniel Schierbeck
 Refactored the GTK window code, creating a single base window class that handles keyboard events.  | 
26  | 
class BranchWindow(Window):  | 
| 
1
by Scott James Remnant
 Commit the first version of bzrk.  | 
27  | 
"""Branch window.  | 
28  | 
||
29  | 
    This object represents and manages a single window containing information
 | 
|
30  | 
    for a particular branch.
 | 
|
31  | 
    """
 | 
|
32  | 
||
| 
452.4.1
by Jelmer Vernooij
 Support displaying multiple tips in viz.  | 
33  | 
def __init__(self, branch, start_revs, maxnum, parent=None):  | 
| 
322
by Jelmer Vernooij
 Add docstrings.  | 
34  | 
"""Create a new BranchWindow.  | 
35  | 
||
36  | 
        :param branch: Branch object for branch to show.
 | 
|
| 
452.4.1
by Jelmer Vernooij
 Support displaying multiple tips in viz.  | 
37  | 
        :param start_revs: Revision ids of top revisions.
 | 
| 
322
by Jelmer Vernooij
 Add docstrings.  | 
38  | 
        :param maxnum: Maximum number of revisions to display, 
 | 
39  | 
                       None for no limit.
 | 
|
40  | 
        """
 | 
|
41  | 
||
| 
298.2.1
by Daniel Schierbeck
 Refactored the GTK window code, creating a single base window class that handles keyboard events.  | 
42  | 
Window.__init__(self, parent=parent)  | 
| 
1
by Scott James Remnant
 Commit the first version of bzrk.  | 
43  | 
self.set_border_width(0)  | 
| 
315
by Daniel Schierbeck
 Removed BranchWindow.set_branch(), used constructor instead.  | 
44  | 
|
| 
330.2.4
by Daniel Schierbeck
 Made use of compact view optional.  | 
45  | 
self.branch = branch  | 
| 
452.4.1
by Jelmer Vernooij
 Support displaying multiple tips in viz.  | 
46  | 
self.start_revs = start_revs  | 
| 
330.2.4
by Daniel Schierbeck
 Made use of compact view optional.  | 
47  | 
self.maxnum = maxnum  | 
| 
330.2.5
by Daniel Schierbeck
 Support persistence of compact view option.  | 
48  | 
self.config = GlobalConfig()  | 
49  | 
||
50  | 
if self.config.get_user_option('viz-compact-view') == 'yes':  | 
|
51  | 
self.compact_view = True  | 
|
52  | 
else:  | 
|
53  | 
self.compact_view = False  | 
|
| 
315
by Daniel Schierbeck
 Removed BranchWindow.set_branch(), used constructor instead.  | 
54  | 
|
55  | 
self.set_title(branch.nick + " - revision history")  | 
|
| 
1
by Scott James Remnant
 Commit the first version of bzrk.  | 
56  | 
|
57  | 
        # Use three-quarters of the screen by default
 | 
|
58  | 
screen = self.get_screen()  | 
|
| 
4
by Scott James Remnant
 Use the size of the first monitor rather than the entire screen  | 
59  | 
monitor = screen.get_monitor_geometry(0)  | 
60  | 
width = int(monitor.width * 0.75)  | 
|
61  | 
height = int(monitor.height * 0.75)  | 
|
| 
1
by Scott James Remnant
 Commit the first version of bzrk.  | 
62  | 
self.set_default_size(width, height)  | 
63  | 
||
64  | 
        # FIXME AndyFitz!
 | 
|
65  | 
icon = self.render_icon(gtk.STOCK_INDEX, gtk.ICON_SIZE_BUTTON)  | 
|
66  | 
self.set_icon(icon)  | 
|
67  | 
||
| 
384
by Daniel Schierbeck
 Added accelerator for Next Revision action.  | 
68  | 
gtk.accel_map_add_entry("<viz>/Go/Next Revision", gtk.keysyms.Up, gtk.gdk.MOD1_MASK)  | 
| 
383
by Daniel Schierbeck
 Switched to using symbolic names for keyvals.  | 
69  | 
gtk.accel_map_add_entry("<viz>/Go/Previous Revision", gtk.keysyms.Down, gtk.gdk.MOD1_MASK)  | 
| 
499.1.1
by Russ Brown
 Added Refresh menu option with keyboard shortcut to viz  | 
70  | 
gtk.accel_map_add_entry("<viz>/View/Refresh", gtk.keysyms.F5, 0)  | 
| 
382
by Daniel Schierbeck
 Made accelerator for Previous Revision work.  | 
71  | 
|
| 
3
by Scott James Remnant
 Split the display in two with a pane, we'll use the bottom half to show  | 
72  | 
self.accel_group = gtk.AccelGroup()  | 
73  | 
self.add_accel_group(self.accel_group)  | 
|
74  | 
||
| 
388
by Daniel Schierbeck
 Switched to using the Previous/Next Revision actions to create tool buttons.  | 
75  | 
gtk.Action.set_tool_item_type(gtk.MenuToolButton)  | 
76  | 
||
| 
385
by Daniel Schierbeck
 Created a single action for Previous Revision.  | 
77  | 
self.prev_rev_action = gtk.Action("prev-rev", "_Previous Revision", "Go to the previous revision", gtk.STOCK_GO_DOWN)  | 
78  | 
self.prev_rev_action.set_accel_path("<viz>/Go/Previous Revision")  | 
|
79  | 
self.prev_rev_action.set_accel_group(self.accel_group)  | 
|
80  | 
self.prev_rev_action.connect("activate", self._back_clicked_cb)  | 
|
81  | 
self.prev_rev_action.connect_accelerator()  | 
|
82  | 
||
| 
386
by Daniel Schierbeck
 Created a single action for Next Revision.  | 
83  | 
self.next_rev_action = gtk.Action("next-rev", "_Next Revision", "Go to the next revision", gtk.STOCK_GO_UP)  | 
84  | 
self.next_rev_action.set_accel_path("<viz>/Go/Next Revision")  | 
|
85  | 
self.next_rev_action.set_accel_group(self.accel_group)  | 
|
86  | 
self.next_rev_action.connect("activate", self._fwd_clicked_cb)  | 
|
87  | 
self.next_rev_action.connect_accelerator()  | 
|
88  | 
||
| 
499.1.1
by Russ Brown
 Added Refresh menu option with keyboard shortcut to viz  | 
89  | 
self.refresh_action = gtk.Action("refresh", "_Refresh", "Refresh view", gtk.STOCK_REFRESH)  | 
90  | 
self.refresh_action.set_accel_path("<viz>/View/Refresh")  | 
|
91  | 
self.refresh_action.set_accel_group(self.accel_group)  | 
|
92  | 
self.refresh_action.connect("activate", self._refresh_clicked)  | 
|
93  | 
self.refresh_action.connect_accelerator()  | 
|
94  | 
||
| 
1
by Scott James Remnant
 Commit the first version of bzrk.  | 
95  | 
self.construct()  | 
96  | 
||
| 
369
by Daniel Schierbeck
 Fixed bug with compact view toggling.  | 
97  | 
def set_revision(self, revid):  | 
98  | 
self.treeview.set_revision_id(revid)  | 
|
| 
330.2.4
by Daniel Schierbeck
 Made use of compact view optional.  | 
99  | 
|
| 
1
by Scott James Remnant
 Commit the first version of bzrk.  | 
100  | 
def construct(self):  | 
101  | 
"""Construct the window contents."""  | 
|
| 
331
by Daniel Schierbeck
 Added basic menu bar.  | 
102  | 
vbox = gtk.VBox(spacing=0)  | 
| 
44
by David Allouche
 reorganise branch window  | 
103  | 
self.add(vbox)  | 
104  | 
||
| 
375
by Daniel Schierbeck
 Fixed crash when toggling compact view.  | 
105  | 
self.paned = gtk.VPaned()  | 
106  | 
self.paned.pack1(self.construct_top(), resize=True, shrink=False)  | 
|
107  | 
self.paned.pack2(self.construct_bottom(), resize=False, shrink=True)  | 
|
108  | 
self.paned.show()  | 
|
| 
358
by Daniel Schierbeck
 Generalized the hiding/showing code.  | 
109  | 
|
| 
331
by Daniel Schierbeck
 Added basic menu bar.  | 
110  | 
vbox.pack_start(self.construct_menubar(), expand=False, fill=True)  | 
| 
44
by David Allouche
 reorganise branch window  | 
111  | 
vbox.pack_start(self.construct_navigation(), expand=False, fill=True)  | 
| 
280.2.1
by Gary van der Merwe
 Add a message to the viz window to indicate that graph is still loading.  | 
112  | 
|
| 
369
by Daniel Schierbeck
 Fixed bug with compact view toggling.  | 
113  | 
vbox.pack_start(self.paned, expand=True, fill=True)  | 
114  | 
vbox.set_focus_child(self.paned)  | 
|
| 
44
by David Allouche
 reorganise branch window  | 
115  | 
|
116  | 
vbox.show()  | 
|
| 
331
by Daniel Schierbeck
 Added basic menu bar.  | 
117  | 
|
118  | 
def construct_menubar(self):  | 
|
119  | 
menubar = gtk.MenuBar()  | 
|
120  | 
||
121  | 
file_menu = gtk.Menu()  | 
|
| 
334
by Daniel Schierbeck
 Added icons to menus.  | 
122  | 
file_menuitem = gtk.MenuItem("_File")  | 
| 
331
by Daniel Schierbeck
 Added basic menu bar.  | 
123  | 
file_menuitem.set_submenu(file_menu)  | 
124  | 
||
| 
362
by Daniel Schierbeck
 Added accel group to File -> Close menu item.  | 
125  | 
file_menu_close = gtk.ImageMenuItem(gtk.STOCK_CLOSE, self.accel_group)  | 
| 
331
by Daniel Schierbeck
 Added basic menu bar.  | 
126  | 
file_menu_close.connect('activate', lambda x: self.destroy())  | 
127  | 
||
| 
363
by Daniel Schierbeck
 Added File -> Quit menu item.  | 
128  | 
file_menu_quit = gtk.ImageMenuItem(gtk.STOCK_QUIT, self.accel_group)  | 
129  | 
file_menu_quit.connect('activate', lambda x: gtk.main_quit())  | 
|
130  | 
||
| 
408
by Daniel Schierbeck
 Made the close menu item actually appear when the viz is opened from another window.  | 
131  | 
if self._parent is not None:  | 
| 
406
by Daniel Schierbeck
 Made the viz show the close menu item only if opened from another window.  | 
132  | 
file_menu.add(file_menu_close)  | 
| 
363
by Daniel Schierbeck
 Added File -> Quit menu item.  | 
133  | 
file_menu.add(file_menu_quit)  | 
| 
331
by Daniel Schierbeck
 Added basic menu bar.  | 
134  | 
|
| 
338
by Daniel Schierbeck
 Added Preferences menu item.  | 
135  | 
edit_menu = gtk.Menu()  | 
136  | 
edit_menuitem = gtk.MenuItem("_Edit")  | 
|
137  | 
edit_menuitem.set_submenu(edit_menu)  | 
|
138  | 
||
| 
340
by Daniel Schierbeck
 Added edit->find menu item stub.  | 
139  | 
edit_menu_find = gtk.ImageMenuItem(gtk.STOCK_FIND)  | 
140  | 
||
| 
361
by Daniel Schierbeck
 Added branch settings menu item.  | 
141  | 
edit_menu_branchopts = gtk.MenuItem("Branch Settings")  | 
142  | 
edit_menu_branchopts.connect('activate', lambda x: PreferencesWindow(self.branch.get_config()).show())  | 
|
143  | 
||
| 
407
by Daniel Schierbeck
 Renamed Preferences menu item into Global Settings.  | 
144  | 
edit_menu_globopts = gtk.MenuItem("Global Settings")  | 
145  | 
edit_menu_globopts.connect('activate', lambda x: PreferencesWindow().show())  | 
|
| 
338
by Daniel Schierbeck
 Added Preferences menu item.  | 
146  | 
|
| 
340
by Daniel Schierbeck
 Added edit->find menu item stub.  | 
147  | 
edit_menu.add(edit_menu_find)  | 
| 
361
by Daniel Schierbeck
 Added branch settings menu item.  | 
148  | 
edit_menu.add(edit_menu_branchopts)  | 
| 
407
by Daniel Schierbeck
 Renamed Preferences menu item into Global Settings.  | 
149  | 
edit_menu.add(edit_menu_globopts)  | 
| 
338
by Daniel Schierbeck
 Added Preferences menu item.  | 
150  | 
|
| 
348
by Daniel Schierbeck
 Added toggle item for revision number column.  | 
151  | 
view_menu = gtk.Menu()  | 
152  | 
view_menuitem = gtk.MenuItem("_View")  | 
|
153  | 
view_menuitem.set_submenu(view_menu)  | 
|
154  | 
||
| 
499.1.1
by Russ Brown
 Added Refresh menu option with keyboard shortcut to viz  | 
155  | 
view_menu_refresh = self.refresh_action.create_menu_item()  | 
156  | 
view_menu_refresh.connect('activate', self._refresh_clicked)  | 
|
157  | 
||
158  | 
view_menu.add(view_menu_refresh)  | 
|
159  | 
view_menu.add(gtk.SeparatorMenuItem())  | 
|
160  | 
||
| 
351
by Daniel Schierbeck
 Added option to hide the toolbar.  | 
161  | 
view_menu_toolbar = gtk.CheckMenuItem("Show Toolbar")  | 
162  | 
view_menu_toolbar.set_active(True)  | 
|
163  | 
view_menu_toolbar.connect('toggled', self._toolbar_visibility_changed)  | 
|
164  | 
||
| 
370
by Daniel Schierbeck
 Moved compact graph toggle to the menubar.  | 
165  | 
view_menu_compact = gtk.CheckMenuItem("Show Compact Graph")  | 
166  | 
view_menu_compact.set_active(self.compact_view)  | 
|
167  | 
view_menu_compact.connect('activate', self._brokenlines_toggled_cb)  | 
|
168  | 
||
| 
351
by Daniel Schierbeck
 Added option to hide the toolbar.  | 
169  | 
view_menu.add(view_menu_toolbar)  | 
| 
370
by Daniel Schierbeck
 Moved compact graph toggle to the menubar.  | 
170  | 
view_menu.add(view_menu_compact)  | 
| 
351
by Daniel Schierbeck
 Added option to hide the toolbar.  | 
171  | 
view_menu.add(gtk.SeparatorMenuItem())  | 
| 
358
by Daniel Schierbeck
 Generalized the hiding/showing code.  | 
172  | 
|
| 
452.4.2
by Jelmer Vernooij
 Hide revision number column if more than one branch was specified.  | 
173  | 
self.mnu_show_revno_column = gtk.CheckMenuItem("Show Revision _Number Column")  | 
174  | 
self.mnu_show_date_column = gtk.CheckMenuItem("Show _Date Column")  | 
|
175  | 
||
176  | 
        # Revision numbers are pointless if there are multiple branches
 | 
|
177  | 
if len(self.start_revs) > 1:  | 
|
178  | 
self.mnu_show_revno_column.set_sensitive(False)  | 
|
179  | 
self.treeview.set_property('revno-column-visible', False)  | 
|
180  | 
||
181  | 
for (col, name) in [(self.mnu_show_revno_column, "revno"),  | 
|
182  | 
(self.mnu_show_date_column, "date")]:  | 
|
| 
358
by Daniel Schierbeck
 Generalized the hiding/showing code.  | 
183  | 
col.set_active(self.treeview.get_property(name + "-column-visible"))  | 
184  | 
col.connect('toggled', self._col_visibility_changed, name)  | 
|
185  | 
view_menu.add(col)  | 
|
| 
348
by Daniel Schierbeck
 Added toggle item for revision number column.  | 
186  | 
|
| 
331
by Daniel Schierbeck
 Added basic menu bar.  | 
187  | 
go_menu = gtk.Menu()  | 
| 
382
by Daniel Schierbeck
 Made accelerator for Previous Revision work.  | 
188  | 
go_menu.set_accel_group(self.accel_group)  | 
| 
334
by Daniel Schierbeck
 Added icons to menus.  | 
189  | 
go_menuitem = gtk.MenuItem("_Go")  | 
| 
331
by Daniel Schierbeck
 Added basic menu bar.  | 
190  | 
go_menuitem.set_submenu(go_menu)  | 
191  | 
||
| 
390
by Daniel Schierbeck
 Made the Previous/Next Revision menu items local variables.  | 
192  | 
go_menu_next = self.next_rev_action.create_menu_item()  | 
193  | 
go_menu_prev = self.prev_rev_action.create_menu_item()  | 
|
| 
334
by Daniel Schierbeck
 Added icons to menus.  | 
194  | 
|
| 
450.4.1
by Daniel Schierbeck
 Added tag icon to branch history window.  | 
195  | 
tag_image = gtk.Image()  | 
196  | 
tag_image.set_from_file(icon_path("tag-16.png"))  | 
|
197  | 
self.go_menu_tags = gtk.ImageMenuItem("_Tags")  | 
|
198  | 
self.go_menu_tags.set_image(tag_image)  | 
|
| 
423.7.5
by Daniel Schierbeck
 Made the revision history window update the Go->Tags menu when a tag is added.  | 
199  | 
self._update_tags()  | 
| 
399
by Daniel Schierbeck
 Made tags menu insensitive when there are no tags to display.  | 
200  | 
|
| 
390
by Daniel Schierbeck
 Made the Previous/Next Revision menu items local variables.  | 
201  | 
go_menu.add(go_menu_next)  | 
202  | 
go_menu.add(go_menu_prev)  | 
|
| 
334
by Daniel Schierbeck
 Added icons to menus.  | 
203  | 
go_menu.add(gtk.SeparatorMenuItem())  | 
| 
423.7.5
by Daniel Schierbeck
 Made the revision history window update the Go->Tags menu when a tag is added.  | 
204  | 
go_menu.add(self.go_menu_tags)  | 
| 
334
by Daniel Schierbeck
 Added icons to menus.  | 
205  | 
|
| 
335
by Daniel Schierbeck
 Added Revision menu.  | 
206  | 
revision_menu = gtk.Menu()  | 
207  | 
revision_menuitem = gtk.MenuItem("_Revision")  | 
|
208  | 
revision_menuitem.set_submenu(revision_menu)  | 
|
209  | 
||
| 
364
by Daniel Schierbeck
 Simplified TreeView.show_diff() and made the Revision -> View Changes menu item work.  | 
210  | 
revision_menu_diff = gtk.MenuItem("View Changes")  | 
211  | 
revision_menu_diff.connect('activate',  | 
|
| 
463.3.1
by Javier Derderian
 Fixed menu entry 'View Changes'. Bug #215350  | 
212  | 
self._menu_diff_cb)  | 
| 
461.1.3
by Javier Derderian
 Added "compare with" option to revisions menu.  | 
213  | 
|
214  | 
revision_menu_compare = gtk.MenuItem("Compare with...")  | 
|
215  | 
revision_menu_compare.connect('activate',  | 
|
216  | 
self._compare_with_cb)  | 
|
| 
364
by Daniel Schierbeck
 Simplified TreeView.show_diff() and made the Revision -> View Changes menu item work.  | 
217  | 
|
| 
365
by Daniel Schierbeck
 Fixed locks and made tagging work.  | 
218  | 
revision_menu_tag = gtk.MenuItem("Tag Revision")  | 
219  | 
revision_menu_tag.connect('activate', self._tag_revision_cb)  | 
|
220  | 
||
221  | 
revision_menu.add(revision_menu_tag)  | 
|
| 
364
by Daniel Schierbeck
 Simplified TreeView.show_diff() and made the Revision -> View Changes menu item work.  | 
222  | 
revision_menu.add(revision_menu_diff)  | 
| 
461.1.3
by Javier Derderian
 Added "compare with" option to revisions menu.  | 
223  | 
revision_menu.add(revision_menu_compare)  | 
| 
335
by Daniel Schierbeck
 Added Revision menu.  | 
224  | 
|
| 
334
by Daniel Schierbeck
 Added icons to menus.  | 
225  | 
branch_menu = gtk.Menu()  | 
226  | 
branch_menuitem = gtk.MenuItem("_Branch")  | 
|
227  | 
branch_menuitem.set_submenu(branch_menu)  | 
|
228  | 
||
| 
336
by Daniel Schierbeck
 Changed wording to comply with HIG guidelines.  | 
229  | 
branch_menu.add(gtk.MenuItem("Pu_ll Revisions"))  | 
230  | 
branch_menu.add(gtk.MenuItem("Pu_sh Revisions"))  | 
|
| 
371.1.1
by Daniel Schierbeck
 Added About dialog to the viz.  | 
231  | 
|
| 
511.6.1
by Jelmer Vernooij
 Add Branch/Index option if bzr-search is available.  | 
232  | 
try:  | 
233  | 
from bzrlib.plugins import search  | 
|
234  | 
except ImportError:  | 
|
235  | 
mutter("Didn't find search plugin")  | 
|
236  | 
else:  | 
|
237  | 
branch_index_menuitem = gtk.MenuItem("_Index")  | 
|
238  | 
branch_index_menuitem.connect('activate', self._branch_index_cb)  | 
|
239  | 
branch_menu.add(branch_index_menuitem)  | 
|
240  | 
||
| 
423.9.1
by Daniel Schierbeck
 Added Help->About menu item to the viz.  | 
241  | 
help_menu = gtk.Menu()  | 
242  | 
help_menuitem = gtk.MenuItem("_Help")  | 
|
243  | 
help_menuitem.set_submenu(help_menu)  | 
|
244  | 
||
245  | 
help_about_menuitem = gtk.ImageMenuItem(gtk.STOCK_ABOUT, self.accel_group)  | 
|
246  | 
help_about_menuitem.connect('activate', self._about_dialog_cb)  | 
|
247  | 
||
248  | 
help_menu.add(help_about_menuitem)  | 
|
249  | 
||
| 
331
by Daniel Schierbeck
 Added basic menu bar.  | 
250  | 
menubar.add(file_menuitem)  | 
| 
338
by Daniel Schierbeck
 Added Preferences menu item.  | 
251  | 
menubar.add(edit_menuitem)  | 
| 
348
by Daniel Schierbeck
 Added toggle item for revision number column.  | 
252  | 
menubar.add(view_menuitem)  | 
| 
331
by Daniel Schierbeck
 Added basic menu bar.  | 
253  | 
menubar.add(go_menuitem)  | 
| 
335
by Daniel Schierbeck
 Added Revision menu.  | 
254  | 
menubar.add(revision_menuitem)  | 
| 
331
by Daniel Schierbeck
 Added basic menu bar.  | 
255  | 
menubar.add(branch_menuitem)  | 
| 
423.9.1
by Daniel Schierbeck
 Added Help->About menu item to the viz.  | 
256  | 
menubar.add(help_menuitem)  | 
| 
331
by Daniel Schierbeck
 Added basic menu bar.  | 
257  | 
menubar.show_all()  | 
258  | 
||
259  | 
return menubar  | 
|
| 
3
by Scott James Remnant
 Split the display in two with a pane, we'll use the bottom half to show  | 
260  | 
|
261  | 
def construct_top(self):  | 
|
262  | 
"""Construct the top-half of the window."""  | 
|
| 
329
by Jelmer Vernooij
 Make broken_line_length setting from higher up.  | 
263  | 
        # FIXME: Make broken_line_length configurable
 | 
| 
330.2.5
by Daniel Schierbeck
 Support persistence of compact view option.  | 
264  | 
|
| 
452.4.1
by Jelmer Vernooij
 Support displaying multiple tips in viz.  | 
265  | 
self.treeview = TreeView(self.branch, self.start_revs, self.maxnum, self.compact_view)  | 
| 
315
by Daniel Schierbeck
 Removed BranchWindow.set_branch(), used constructor instead.  | 
266  | 
|
| 
373
by Daniel Schierbeck
 Made column display options persisted.  | 
267  | 
self.treeview.connect('revision-selected',  | 
| 
303
by Daniel Schierbeck
 Made basic signaling work.  | 
268  | 
self._treeselection_changed_cb)  | 
| 
423.1.17
by Gary van der Merwe
 Reuse the viz treeview in the revision browser.  | 
269  | 
self.treeview.connect('revision-activated',  | 
270  | 
self._tree_revision_activated)  | 
|
| 
303
by Daniel Schierbeck
 Made basic signaling work.  | 
271  | 
|
| 
423.7.5
by Daniel Schierbeck
 Made the revision history window update the Go->Tags menu when a tag is added.  | 
272  | 
self.treeview.connect('tag-added', lambda w, t, r: self._update_tags())  | 
273  | 
||
| 
373
by Daniel Schierbeck
 Made column display options persisted.  | 
274  | 
for col in ["revno", "date"]:  | 
275  | 
option = self.config.get_user_option(col + '-column-visible')  | 
|
276  | 
if option is not None:  | 
|
277  | 
self.treeview.set_property(col + '-column-visible', option == 'True')  | 
|
| 
464.1.1
by Adrian Wilkins
 Fixed column visibility properties not loading  | 
278  | 
else:  | 
279  | 
self.treeview.set_property(col + '-column-visible', False)  | 
|
| 
373
by Daniel Schierbeck
 Made column display options persisted.  | 
280  | 
|
| 
1
by Scott James Remnant
 Commit the first version of bzrk.  | 
281  | 
self.treeview.show()  | 
282  | 
||
| 
375
by Daniel Schierbeck
 Fixed crash when toggling compact view.  | 
283  | 
align = gtk.Alignment(0.0, 0.0, 1.0, 1.0)  | 
284  | 
align.set_padding(5, 0, 0, 0)  | 
|
285  | 
align.add(self.treeview)  | 
|
286  | 
align.show()  | 
|
287  | 
||
288  | 
return align  | 
|
| 
44
by David Allouche
 reorganise branch window  | 
289  | 
|
290  | 
def construct_navigation(self):  | 
|
291  | 
"""Construct the navigation buttons."""  | 
|
| 
325
by Daniel Schierbeck
 Switched to using a real toolbar for the viz navigation.  | 
292  | 
self.toolbar = gtk.Toolbar()  | 
293  | 
self.toolbar.set_style(gtk.TOOLBAR_BOTH_HORIZ)  | 
|
| 
3
by Scott James Remnant
 Split the display in two with a pane, we'll use the bottom half to show  | 
294  | 
|
| 
388
by Daniel Schierbeck
 Switched to using the Previous/Next Revision actions to create tool buttons.  | 
295  | 
self.prev_button = self.prev_rev_action.create_tool_item()  | 
| 
376
by Daniel Schierbeck
 Changed 'back' into 'prev' and 'fwd' into 'next'.  | 
296  | 
self.toolbar.insert(self.prev_button, -1)  | 
| 
3
by Scott James Remnant
 Split the display in two with a pane, we'll use the bottom half to show  | 
297  | 
|
| 
388
by Daniel Schierbeck
 Switched to using the Previous/Next Revision actions to create tool buttons.  | 
298  | 
self.next_button = self.next_rev_action.create_tool_item()  | 
| 
376
by Daniel Schierbeck
 Changed 'back' into 'prev' and 'fwd' into 'next'.  | 
299  | 
self.toolbar.insert(self.next_button, -1)  | 
| 
330.2.4
by Daniel Schierbeck
 Made use of compact view optional.  | 
300  | 
|
| 
401.1.2
by Daniel Schierbeck
 Allowed the treeview to be refreshed.  | 
301  | 
self.toolbar.insert(gtk.SeparatorToolItem(), -1)  | 
302  | 
||
303  | 
refresh_button = gtk.ToolButton(gtk.STOCK_REFRESH)  | 
|
| 
404
by Daniel Schierbeck
 Made the refresh use proper locking.  | 
304  | 
refresh_button.connect('clicked', self._refresh_clicked)  | 
| 
401.1.2
by Daniel Schierbeck
 Allowed the treeview to be refreshed.  | 
305  | 
self.toolbar.insert(refresh_button, -1)  | 
306  | 
||
| 
330.2.4
by Daniel Schierbeck
 Made use of compact view optional.  | 
307  | 
self.toolbar.show_all()  | 
| 
325
by Daniel Schierbeck
 Switched to using a real toolbar for the viz navigation.  | 
308  | 
|
309  | 
return self.toolbar  | 
|
| 
3
by Scott James Remnant
 Split the display in two with a pane, we'll use the bottom half to show  | 
310  | 
|
311  | 
def construct_bottom(self):  | 
|
312  | 
"""Construct the bottom half of the window."""  | 
|
| 
330.3.1
by Daniel Schierbeck
 Renamed logview 'revisionview'.  | 
313  | 
from bzrlib.plugins.gtk.revisionview import RevisionView  | 
| 
412.1.2
by Daniel Schierbeck
 Moved retrieval of tags into the revisionview itself.  | 
314  | 
self.revisionview = RevisionView(branch=self.branch)  | 
| 
44
by David Allouche
 reorganise branch window  | 
315  | 
(width, height) = self.get_size()  | 
| 
330.3.1
by Daniel Schierbeck
 Renamed logview 'revisionview'.  | 
316  | 
self.revisionview.set_size_request(width, int(height / 2.5))  | 
317  | 
self.revisionview.show()  | 
|
318  | 
self.revisionview.set_show_callback(self._show_clicked_cb)  | 
|
| 
412.1.9
by Daniel Schierbeck
 Removed the use of RevisionView.set_go_callback().  | 
319  | 
self.revisionview.connect('notify::revision', self._go_clicked_cb)  | 
| 
423.7.4
by Daniel Schierbeck
 Made revisionview and branchview update when a tag is added.  | 
320  | 
self.treeview.connect('tag-added', lambda w, t, r: self.revisionview.update_tags())  | 
| 
330.3.1
by Daniel Schierbeck
 Renamed logview 'revisionview'.  | 
321  | 
return self.revisionview  | 
| 
332
by Daniel Schierbeck
 Made tag selection work.  | 
322  | 
|
323  | 
def _tag_selected_cb(self, menuitem, revid):  | 
|
| 
356
by Daniel Schierbeck
 Made revision a property on TreeView.  | 
324  | 
self.treeview.set_revision_id(revid)  | 
| 
341
by Daniel Schierbeck
 Merged with trunk.  | 
325  | 
|
| 
280.1.2
by Daniel Schierbeck
 Switched to handle the 'changed' signal from the treeview's treeselection instead of the 'cursor-changed' signal from the treeview itself, allowing more flexibility (particularly the ability to handle programmatic selections)  | 
326  | 
def _treeselection_changed_cb(self, selection, *args):  | 
| 
303
by Daniel Schierbeck
 Made basic signaling work.  | 
327  | 
"""callback for when the treeview changes."""  | 
328  | 
revision = self.treeview.get_revision()  | 
|
329  | 
parents = self.treeview.get_parents()  | 
|
330  | 
children = self.treeview.get_children()  | 
|
331  | 
||
| 
464.2.1
by Adrian Wilkins
 Detect the reserved null: revision in appropriate places.  | 
332  | 
if revision and revision != NULL_REVISION:  | 
| 
376
by Daniel Schierbeck
 Changed 'back' into 'prev' and 'fwd' into 'next'.  | 
333  | 
prev_menu = gtk.Menu()  | 
| 
352.1.1
by Daniel Schierbeck
 Added dropdown menu to Back button.  | 
334  | 
if len(parents) > 0:  | 
| 
385
by Daniel Schierbeck
 Created a single action for Previous Revision.  | 
335  | 
self.prev_rev_action.set_sensitive(True)  | 
| 
352.1.1
by Daniel Schierbeck
 Added dropdown menu to Back button.  | 
336  | 
for parent_id in parents:  | 
| 
464.2.1
by Adrian Wilkins
 Detect the reserved null: revision in appropriate places.  | 
337  | 
if parent_id and parent_id != NULL_REVISION:  | 
338  | 
parent = self.branch.repository.get_revision(parent_id)  | 
|
339  | 
try:  | 
|
340  | 
str = ' (' + parent.properties['branch-nick'] + ')'  | 
|
341  | 
except KeyError:  | 
|
342  | 
str = ""  | 
|
| 
355
by Daniel Schierbeck
 Appended branch nick to parent and child popup menus.  | 
343  | 
|
| 
464.2.1
by Adrian Wilkins
 Detect the reserved null: revision in appropriate places.  | 
344  | 
item = gtk.MenuItem(parent.message.split("\n")[0] + str)  | 
345  | 
item.connect('activate', self._set_revision_cb, parent_id)  | 
|
346  | 
prev_menu.add(item)  | 
|
| 
376
by Daniel Schierbeck
 Changed 'back' into 'prev' and 'fwd' into 'next'.  | 
347  | 
prev_menu.show_all()  | 
| 
352.1.1
by Daniel Schierbeck
 Added dropdown menu to Back button.  | 
348  | 
else:  | 
| 
385
by Daniel Schierbeck
 Created a single action for Previous Revision.  | 
349  | 
self.prev_rev_action.set_sensitive(False)  | 
| 
376
by Daniel Schierbeck
 Changed 'back' into 'prev' and 'fwd' into 'next'.  | 
350  | 
prev_menu.hide()  | 
351  | 
||
352  | 
self.prev_button.set_menu(prev_menu)  | 
|
353  | 
||
354  | 
next_menu = gtk.Menu()  | 
|
| 
352.1.2
by Daniel Schierbeck
 Added dropdown menu to Forward button.  | 
355  | 
if len(children) > 0:  | 
| 
386
by Daniel Schierbeck
 Created a single action for Next Revision.  | 
356  | 
self.next_rev_action.set_sensitive(True)  | 
| 
352.1.2
by Daniel Schierbeck
 Added dropdown menu to Forward button.  | 
357  | 
for child_id in children:  | 
358  | 
child = self.branch.repository.get_revision(child_id)  | 
|
| 
355
by Daniel Schierbeck
 Appended branch nick to parent and child popup menus.  | 
359  | 
try:  | 
360  | 
str = ' (' + child.properties['branch-nick'] + ')'  | 
|
361  | 
except KeyError:  | 
|
362  | 
str = ""  | 
|
363  | 
||
364  | 
item = gtk.MenuItem(child.message.split("\n")[0] + str)  | 
|
| 
352.1.2
by Daniel Schierbeck
 Added dropdown menu to Forward button.  | 
365  | 
item.connect('activate', self._set_revision_cb, child_id)  | 
| 
376
by Daniel Schierbeck
 Changed 'back' into 'prev' and 'fwd' into 'next'.  | 
366  | 
next_menu.add(item)  | 
367  | 
next_menu.show_all()  | 
|
| 
352.1.2
by Daniel Schierbeck
 Added dropdown menu to Forward button.  | 
368  | 
else:  | 
| 
386
by Daniel Schierbeck
 Created a single action for Next Revision.  | 
369  | 
self.next_rev_action.set_sensitive(False)  | 
| 
376
by Daniel Schierbeck
 Changed 'back' into 'prev' and 'fwd' into 'next'.  | 
370  | 
next_menu.hide()  | 
| 
352.1.2
by Daniel Schierbeck
 Added dropdown menu to Forward button.  | 
371  | 
|
| 
376
by Daniel Schierbeck
 Changed 'back' into 'prev' and 'fwd' into 'next'.  | 
372  | 
self.next_button.set_menu(next_menu)  | 
| 
352.1.2
by Daniel Schierbeck
 Added dropdown menu to Forward button.  | 
373  | 
|
| 
412.1.13
by Daniel Schierbeck
 Re-added support for displaying the children of a revision.  | 
374  | 
self.revisionview.set_revision(revision)  | 
375  | 
self.revisionview.set_children(children)  | 
|
| 
423.1.17
by Gary van der Merwe
 Reuse the viz treeview in the revision browser.  | 
376  | 
|
377  | 
def _tree_revision_activated(self, widget, path, col):  | 
|
378  | 
        # TODO: more than one parent
 | 
|
379  | 
"""Callback for when a treeview row gets activated."""  | 
|
380  | 
revision = self.treeview.get_revision()  | 
|
381  | 
parents = self.treeview.get_parents()  | 
|
382  | 
||
383  | 
if len(parents) == 0:  | 
|
384  | 
parent_id = None  | 
|
385  | 
else:  | 
|
386  | 
parent_id = parents[0]  | 
|
387  | 
||
388  | 
self.show_diff(revision.revision_id, parent_id)  | 
|
389  | 
self.treeview.grab_focus()  | 
|
| 
463.3.1
by Javier Derderian
 Fixed menu entry 'View Changes'. Bug #215350  | 
390  | 
|
391  | 
def _menu_diff_cb(self,w):  | 
|
392  | 
(path, focus) = self.treeview.treeview.get_cursor()  | 
|
393  | 
revid = self.treeview.model[path][treemodel.REVID]  | 
|
394  | 
||
395  | 
parentids = self.branch.repository.revision_parents(revid)  | 
|
396  | 
||
397  | 
if len(parentids) == 0:  | 
|
398  | 
parentid = NULL_REVISION  | 
|
399  | 
else:  | 
|
400  | 
parentid = parentids[0]  | 
|
401  | 
||
402  | 
self.show_diff(revid,parentid)  | 
|
| 
7
by Scott James Remnant
 Put some information about the highlighted revision in the bottom pane,  | 
403  | 
|
| 
3
by Scott James Remnant
 Split the display in two with a pane, we'll use the bottom half to show  | 
404  | 
def _back_clicked_cb(self, *args):  | 
405  | 
"""Callback for when the back button is clicked."""  | 
|
| 
304
by Daniel Schierbeck
 Made forward/back buttons work again.  | 
406  | 
self.treeview.back()  | 
407  | 
||
| 
5
by Scott James Remnant
 Reverse the meaning of the Back and Forward buttons so Back actually  | 
408  | 
def _fwd_clicked_cb(self, *args):  | 
409  | 
"""Callback for when the forward button is clicked."""  | 
|
| 
304
by Daniel Schierbeck
 Made forward/back buttons work again.  | 
410  | 
self.treeview.forward()  | 
| 
7
by Scott James Remnant
 Put some information about the highlighted revision in the bottom pane,  | 
411  | 
|
| 
412.1.9
by Daniel Schierbeck
 Removed the use of RevisionView.set_go_callback().  | 
412  | 
def _go_clicked_cb(self, w, p):  | 
| 
7
by Scott James Remnant
 Put some information about the highlighted revision in the bottom pane,  | 
413  | 
"""Callback for when the go button for a parent is clicked."""  | 
| 
412.1.9
by Daniel Schierbeck
 Removed the use of RevisionView.set_go_callback().  | 
414  | 
if self.revisionview.get_revision() is not None:  | 
415  | 
self.treeview.set_revision(self.revisionview.get_revision())  | 
|
| 
152
by Jelmer Vernooij
 Cleanup some more code.  | 
416  | 
|
| 
147
by Jelmer Vernooij
 Remove a bunch of duplicate functionality.  | 
417  | 
def _show_clicked_cb(self, revid, parentid):  | 
| 
7
by Scott James Remnant
 Put some information about the highlighted revision in the bottom pane,  | 
418  | 
"""Callback for when the show button for a parent is clicked."""  | 
| 
423.1.17
by Gary van der Merwe
 Reuse the viz treeview in the revision browser.  | 
419  | 
self.show_diff(revid, parentid)  | 
| 
13
by Scott James Remnant
 Keep the focus on the treeview  | 
420  | 
self.treeview.grab_focus()  | 
| 
46
by Wouter van Heyst
 show diff on row activation, LP# 44591  | 
421  | 
|
| 
461.1.3
by Javier Derderian
 Added "compare with" option to revisions menu.  | 
422  | 
def _compare_with_cb(self,w):  | 
423  | 
"""Callback for revision 'compare with' menu. Will show a small  | 
|
424  | 
            dialog with branch revisions to compare with selected revision in TreeView"""
 | 
|
425  | 
||
| 
463.2.2
by Javier Derderian
 Updated "Compare with..." (#78765) to use revbrowser.RevisionBrowser.  | 
426  | 
from bzrlib.plugins.gtk.revbrowser import RevisionBrowser  | 
427  | 
||
428  | 
rb = RevisionBrowser(self.branch,self)  | 
|
429  | 
ret = rb.run()  | 
|
430  | 
||
431  | 
if ret == gtk.RESPONSE_OK:  | 
|
| 
461.1.3
by Javier Derderian
 Added "compare with" option to revisions menu.  | 
432  | 
(path, focus) = self.treeview.treeview.get_cursor()  | 
433  | 
revid = self.treeview.model[path][treemodel.REVID]  | 
|
| 
463.2.2
by Javier Derderian
 Updated "Compare with..." (#78765) to use revbrowser.RevisionBrowser.  | 
434  | 
self.show_diff(revid, rb.selected_revid)  | 
435  | 
||
436  | 
rb.destroy()  | 
|
| 
461.1.3
by Javier Derderian
 Added "compare with" option to revisions menu.  | 
437  | 
|
| 
352.1.1
by Daniel Schierbeck
 Added dropdown menu to Back button.  | 
438  | 
def _set_revision_cb(self, w, revision_id):  | 
| 
356
by Daniel Schierbeck
 Made revision a property on TreeView.  | 
439  | 
self.treeview.set_revision_id(revision_id)  | 
| 
352.1.1
by Daniel Schierbeck
 Added dropdown menu to Back button.  | 
440  | 
|
| 
330.2.4
by Daniel Schierbeck
 Made use of compact view optional.  | 
441  | 
def _brokenlines_toggled_cb(self, button):  | 
| 
330.2.5
by Daniel Schierbeck
 Support persistence of compact view option.  | 
442  | 
self.compact_view = button.get_active()  | 
443  | 
||
444  | 
if self.compact_view:  | 
|
445  | 
option = 'yes'  | 
|
| 
330.2.4
by Daniel Schierbeck
 Made use of compact view optional.  | 
446  | 
else:  | 
| 
330.2.5
by Daniel Schierbeck
 Support persistence of compact view option.  | 
447  | 
option = 'no'  | 
448  | 
||
449  | 
self.config.set_user_option('viz-compact-view', option)  | 
|
| 
401.1.3
by Daniel Schierbeck
 Made the compact view toggling cleaner.  | 
450  | 
self.treeview.set_property('compact', self.compact_view)  | 
451  | 
self.treeview.refresh()  | 
|
| 
368
by Daniel Schierbeck
 Merged with mainline.  | 
452  | 
|
| 
365
by Daniel Schierbeck
 Fixed locks and made tagging work.  | 
453  | 
def _tag_revision_cb(self, w):  | 
| 
392.1.1
by Daniel Schierbeck
 Made it possible to tag revisions again.  | 
454  | 
try:  | 
455  | 
self.treeview.set_sensitive(False)  | 
|
456  | 
dialog = AddTagDialog(self.branch.repository, self.treeview.get_revision().revision_id, self.branch)  | 
|
457  | 
response = dialog.run()  | 
|
458  | 
if response != gtk.RESPONSE_NONE:  | 
|
459  | 
dialog.hide()  | 
|
| 
365
by Daniel Schierbeck
 Fixed locks and made tagging work.  | 
460  | 
|
| 
392.1.1
by Daniel Schierbeck
 Made it possible to tag revisions again.  | 
461  | 
if response == gtk.RESPONSE_OK:  | 
| 
423.7.7
by Daniel Schierbeck
 Simplified Go->Tag Revision menu item in the viz.  | 
462  | 
self.treeview.add_tag(dialog.tagname, dialog._revid)  | 
| 
392.1.1
by Daniel Schierbeck
 Made it possible to tag revisions again.  | 
463  | 
|
464  | 
dialog.destroy()  | 
|
465  | 
||
466  | 
finally:  | 
|
467  | 
self.treeview.set_sensitive(True)  | 
|
| 
365
by Daniel Schierbeck
 Fixed locks and made tagging work.  | 
468  | 
|
| 
511.6.1
by Jelmer Vernooij
 Add Branch/Index option if bzr-search is available.  | 
469  | 
def _branch_index_cb(self, w):  | 
470  | 
from bzrlib.plugins.search import index as _mod_index  | 
|
471  | 
_mod_index.index_url(self.branch.base)  | 
|
472  | 
||
| 
423.9.1
by Daniel Schierbeck
 Added Help->About menu item to the viz.  | 
473  | 
def _about_dialog_cb(self, w):  | 
474  | 
from bzrlib.plugins.gtk.about import AboutDialog  | 
|
475  | 
||
476  | 
AboutDialog().run()  | 
|
477  | 
||
| 
348
by Daniel Schierbeck
 Added toggle item for revision number column.  | 
478  | 
def _col_visibility_changed(self, col, property):  | 
| 
373
by Daniel Schierbeck
 Made column display options persisted.  | 
479  | 
self.config.set_user_option(property + '-column-visible', col.get_active())  | 
| 
348
by Daniel Schierbeck
 Added toggle item for revision number column.  | 
480  | 
self.treeview.set_property(property + '-column-visible', col.get_active())  | 
| 
351
by Daniel Schierbeck
 Added option to hide the toolbar.  | 
481  | 
|
482  | 
def _toolbar_visibility_changed(self, col):  | 
|
483  | 
if col.get_active():  | 
|
484  | 
self.toolbar.show()  | 
|
485  | 
else:  | 
|
486  | 
self.toolbar.hide()  | 
|
| 
371.1.1
by Daniel Schierbeck
 Added About dialog to the viz.  | 
487  | 
|
488  | 
def _show_about_cb(self, w):  | 
|
489  | 
dialog = AboutDialog()  | 
|
490  | 
dialog.connect('response', lambda d,r: d.destroy())  | 
|
491  | 
dialog.run()  | 
|
| 
404
by Daniel Schierbeck
 Made the refresh use proper locking.  | 
492  | 
|
493  | 
def _refresh_clicked(self, w):  | 
|
| 
423.1.13
by Gary van der Merwe
 Move viz loading msg from branchwin to treeview.  | 
494  | 
self.treeview.refresh()  | 
| 
423.7.5
by Daniel Schierbeck
 Made the revision history window update the Go->Tags menu when a tag is added.  | 
495  | 
|
496  | 
def _update_tags(self):  | 
|
497  | 
menu = gtk.Menu()  | 
|
498  | 
||
499  | 
if self.branch.supports_tags():  | 
|
500  | 
tags = self.branch.tags.get_tag_dict().items()  | 
|
501  | 
tags.sort()  | 
|
502  | 
tags.reverse()  | 
|
503  | 
for tag, revid in tags:  | 
|
| 
450.4.1
by Daniel Schierbeck
 Added tag icon to branch history window.  | 
504  | 
tag_image = gtk.Image()  | 
505  | 
tag_image.set_from_file(icon_path('tag-16.png'))  | 
|
506  | 
tag_item = gtk.ImageMenuItem(tag.replace('_', '__'))  | 
|
507  | 
tag_item.set_image(tag_image)  | 
|
| 
423.7.5
by Daniel Schierbeck
 Made the revision history window update the Go->Tags menu when a tag is added.  | 
508  | 
tag_item.connect('activate', self._tag_selected_cb, revid)  | 
509  | 
menu.add(tag_item)  | 
|
510  | 
self.go_menu_tags.set_submenu(menu)  | 
|
511  | 
||
512  | 
self.go_menu_tags.set_sensitive(len(tags) != 0)  | 
|
513  | 
else:  | 
|
514  | 
self.go_menu_tags.set_sensitive(False)  | 
|
515  | 
||
516  | 
self.go_menu_tags.show_all()  | 
|
517  | 
||
| 
423.1.17
by Gary van der Merwe
 Reuse the viz treeview in the revision browser.  | 
518  | 
def show_diff(self, revid=None, parentid=None):  | 
519  | 
"""Open a new window to show a diff between the given revisions."""  | 
|
520  | 
from bzrlib.plugins.gtk.diff import DiffWindow  | 
|
521  | 
window = DiffWindow(parent=self)  | 
|
522  | 
||
523  | 
if parentid is None:  | 
|
524  | 
parentid = NULL_REVISION  | 
|
525  | 
||
526  | 
rev_tree = self.branch.repository.revision_tree(revid)  | 
|
527  | 
parent_tree = self.branch.repository.revision_tree(parentid)  | 
|
528  | 
||
529  | 
description = revid + " - " + self.branch.nick  | 
|
530  | 
window.set_diff(description, rev_tree, parent_tree)  | 
|
531  | 
window.show()  | 
|
532  | 
||
| 
423.7.5
by Daniel Schierbeck
 Made the revision history window update the Go->Tags menu when a tag is added.  | 
533  |