197
207
# Apply menu state
198
208
self.menuitem_view_show_hidden_files.set_active(self.pref.get_preference('dotted_files', 'bool'))
210
# We're starting local
212
self.remote_branch = None
213
self.remote_path = None
214
self.remote_revision = None
200
216
self.set_path(os.getcwd())
201
217
self._load_right()
203
219
self._just_started = False
205
def set_path(self, path):
221
def set_path(self, path, force_remote=False):
207
222
self.notbranch = False
210
self.wt, self.wtpath = WorkingTree.open_containing(self.path)
211
except (bzrerrors.NotBranchError, bzrerrors.NoWorkingTree):
212
self.notbranch = True
225
# Forcing remote mode (reading data from inventory)
226
self._show_stock_image(gtk.STOCK_DISCONNECT)
228
br = Branch.open_containing(path)[0]
229
except bzrerrors.NotBranchError:
230
self._show_stock_image(gtk.STOCK_DIALOG_ERROR)
231
self.check_history.set_active(False)
232
self.check_history.set_sensitive(False)
234
except bzrerrors.UnsupportedProtocol:
235
self._show_stock_image(gtk.STOCK_DIALOG_ERROR)
236
self.check_history.set_active(False)
237
self.check_history.set_sensitive(False)
240
self._show_stock_image(gtk.STOCK_CONNECT)
245
self.remote_branch, self.remote_path = Branch.open_containing(path)
247
if self.remote_revision is None:
248
self.remote_revision = self.remote_branch.last_revision()
250
self.remote_entries = self.remote_branch.repository.get_inventory(self.remote_revision).entries()
252
if len(self.remote_path) == 0:
253
self.remote_parent = self.remote_branch.repository.get_inventory(self.remote_branch.last_revision()).iter_entries_by_dir().next()[1].file_id
255
for (name, type) in self.remote_entries:
256
if name == self.remote_path:
257
self.remote_parent = type.file_id
260
if not path.endswith('/'):
263
if self.remote_branch.base == path:
264
self.button_location_up.set_sensitive(False)
266
self.button_location_up.set_sensitive(True)
268
if os.path.isdir(path):
269
self.image_location_error.destroy()
274
self.wt, self.wtpath = WorkingTree.open_containing(path)
275
except (bzrerrors.NotBranchError, bzrerrors.NoWorkingTree):
276
self.notbranch = True
278
# If we're in the root, we cannot go up anymore
279
if sys.platform == 'win32':
280
drive, tail = os.path.splitdrive(path)
281
if tail in ('', '/', '\\'):
282
self.button_location_up.set_sensitive(False)
284
self.button_location_up.set_sensitive(True)
287
self.button_location_up.set_sensitive(False)
289
self.button_location_up.set_sensitive(True)
290
elif not os.path.isfile(path):
291
# Doesn't seem to be a file nor a directory, trying to open a
293
self._show_stock_image(gtk.STOCK_DISCONNECT)
295
br = Branch.open_containing(path)[0]
296
except bzrerrors.NotBranchError:
297
self._show_stock_image(gtk.STOCK_DIALOG_ERROR)
298
self.check_history.set_active(False)
299
self.check_history.set_sensitive(False)
301
except bzrerrors.UnsupportedProtocol:
302
self._show_stock_image(gtk.STOCK_DIALOG_ERROR)
303
self.check_history.set_active(False)
304
self.check_history.set_sensitive(False)
307
self._show_stock_image(gtk.STOCK_CONNECT)
312
self.remote_branch, self.remote_path = Branch.open_containing(path)
314
if self.remote_revision is None:
315
self.remote_revision = self.remote_branch.last_revision()
317
self.remote_entries = self.remote_branch.repository.get_inventory(self.remote_revision).entries()
319
if len(self.remote_path) == 0:
320
self.remote_parent = self.remote_branch.repository.get_inventory(self.remote_branch.last_revision()).iter_entries_by_dir().next()[1].file_id
322
for (name, type) in self.remote_entries:
323
if name == self.remote_path:
324
self.remote_parent = type.file_id
327
if not path.endswith('/'):
330
if self.remote_branch.base == path:
331
self.button_location_up.set_sensitive(False)
333
self.button_location_up.set_sensitive(True)
336
self.check_history.set_active(False)
337
self.check_history.set_sensitive(False)
339
self.check_history.set_sensitive(True)
214
341
self.statusbar.push(self.context_id, path)
215
342
self.entry_location.set_text(path)
217
# If we're in the root, we cannot go up anymore
218
if sys.platform == 'win32':
219
drive, tail = os.path.splitdrive(self.path)
220
if tail in ('', '/', '\\'):
221
self.button_location_up.set_sensitive(False)
223
self.button_location_up.set_sensitive(True)
226
self.button_location_up.set_sensitive(False)
228
self.button_location_up.set_sensitive(True)
230
346
def get_path(self):
351
if len(self.remote_path) > 0:
352
return self.remote_branch.base + self.remote_path + '/'
354
return self.remote_branch.base
233
356
def on_about_activate(self, widget):
234
357
from bzrlib.plugins.gtk.dialog import about
237
def on_button_location_up_clicked(self, widget):
238
""" Location Up button handler. """
239
self.set_path(os.path.split(self.get_path())[0])
361
def on_button_history_browse_clicked(self, widget):
362
""" Browse for revision button handler. """
364
br = self.remote_branch
368
revb = RevisionBrowser(br, self.window)
369
response = revb.run()
370
if response != gtk.RESPONSE_NONE:
373
if response == gtk.RESPONSE_OK:
374
if revb.selected_revno is not None:
375
self.entry_history.set_text(revb.selected_revno)
242
379
def on_button_location_jump_clicked(self, widget):
243
380
""" Location Jump button handler. """
244
381
location = self.entry_location.get_text()
245
if os.path.isdir(location):
246
self.set_path(location)
383
if self.set_path(location):
247
384
self.refresh_right()
248
self.image_location_error.hide()
250
self.image_location_error.show()
386
def on_button_location_up_clicked(self, widget):
387
""" Location Up button handler. """
390
self.set_path(os.path.split(self.get_path())[0])
394
newpath = delim.join(self.get_path().split(delim)[:-2])
396
self.set_path(newpath)
400
def on_checkbutton_history_toggled(self, widget):
401
""" History Mode toggle handler. """
402
if self.check_history.get_active():
403
# History Mode activated
404
self.entry_history.set_sensitive(True)
405
self.button_history.set_sensitive(True)
407
# History Mode deactivated
408
self.entry_history.set_sensitive(False)
409
self.button_history.set_sensitive(False)
412
def on_entry_history_revno_key_press_event(self, widget, event):
413
""" Key pressed handler for the history entry. """
414
if event.keyval == 65293:
415
# Return was hit, so we have to load that specific revision
416
# Emulate being remote, so inventory should be used
417
path = self.get_path()
420
self.remote_branch = self.wt.branch
422
revno = int(self.entry_history.get_text())
423
self.remote_revision = self.remote_branch.get_rev_id(revno)
424
if self.set_path(path, True):
252
427
def on_entry_location_key_press_event(self, widget, event):
253
428
""" Key pressed handler for the location entry. """
536
723
selected=self.get_selected_right(),
538
725
# get the menu items
726
m_open = menu.ui.get_widget('/context_right/open')
539
727
m_add = menu.ui.get_widget('/context_right/add')
540
728
m_remove = menu.ui.get_widget('/context_right/remove')
541
729
m_rename = menu.ui.get_widget('/context_right/rename')
542
730
m_revert = menu.ui.get_widget('/context_right/revert')
543
731
m_commit = menu.ui.get_widget('/context_right/commit')
732
m_annotate = menu.ui.get_widget('/context_right/annotate')
544
733
m_diff = menu.ui.get_widget('/context_right/diff')
545
734
# check if we're in a branch
547
736
from bzrlib.branch import Branch
548
737
Branch.open_containing(self.get_path())
549
m_add.set_sensitive(True)
550
m_remove.set_sensitive(True)
551
m_rename.set_sensitive(True)
552
m_revert.set_sensitive(True)
553
m_commit.set_sensitive(True)
554
m_diff.set_sensitive(True)
739
m_open.set_sensitive(False)
740
m_add.set_sensitive(False)
741
m_remove.set_sensitive(False)
742
m_rename.set_sensitive(False)
743
m_revert.set_sensitive(False)
744
m_commit.set_sensitive(False)
745
m_annotate.set_sensitive(False)
746
m_diff.set_sensitive(False)
748
m_open.set_sensitive(True)
749
m_add.set_sensitive(True)
750
m_remove.set_sensitive(True)
751
m_rename.set_sensitive(True)
752
m_revert.set_sensitive(True)
753
m_commit.set_sensitive(True)
754
m_annotate.set_sensitive(True)
755
m_diff.set_sensitive(True)
555
756
except bzrerrors.NotBranchError:
757
m_open.set_sensitive(True)
556
758
m_add.set_sensitive(False)
557
759
m_remove.set_sensitive(False)
558
760
m_rename.set_sensitive(False)
559
761
m_revert.set_sensitive(False)
560
762
m_commit.set_sensitive(False)
763
m_annotate.set_sensitive(False)
561
764
m_diff.set_sensitive(False)
563
menu.right_context_menu().popup(None, None, None, 0,
767
menu.right_context_menu().popup(None, None, None, 0,
770
menu.remote_context_menu().popup(None, None, None, 0,
566
773
def on_treeview_right_row_activated(self, treeview, path, view_column):
567
774
""" Occurs when somebody double-clicks or enters an item in the
702
934
st = _('unknown')
704
936
statinfo = os.stat(self.path + os.sep + item)
705
liststore.append([gtk.STOCK_FILE, False, item, st, status, statinfo.st_size, self._format_size(statinfo.st_size), statinfo.st_mtime, self._format_date(statinfo.st_mtime)])
937
liststore.append([gtk.STOCK_FILE,
943
self._format_size(statinfo.st_size),
945
self._format_date(statinfo.st_mtime),
707
948
# Create the columns and add them to the TreeView
708
949
self.treeview_right.set_model(liststore)
709
tvcolumn_filename = gtk.TreeViewColumn(_('Filename'))
710
tvcolumn_status = gtk.TreeViewColumn(_('Status'))
711
tvcolumn_size = gtk.TreeViewColumn(_('Size'))
712
tvcolumn_mtime = gtk.TreeViewColumn(_('Last modified'))
713
self.treeview_right.append_column(tvcolumn_filename)
714
self.treeview_right.append_column(tvcolumn_status)
715
self.treeview_right.append_column(tvcolumn_size)
716
self.treeview_right.append_column(tvcolumn_mtime)
950
self._tvcolumn_filename = gtk.TreeViewColumn(_('Filename'))
951
self._tvcolumn_status = gtk.TreeViewColumn(_('Status'))
952
self._tvcolumn_size = gtk.TreeViewColumn(_('Size'))
953
self._tvcolumn_mtime = gtk.TreeViewColumn(_('Last modified'))
954
self.treeview_right.append_column(self._tvcolumn_filename)
955
self.treeview_right.append_column(self._tvcolumn_status)
956
self.treeview_right.append_column(self._tvcolumn_size)
957
self.treeview_right.append_column(self._tvcolumn_mtime)
718
959
# Set up the cells
719
960
cellpb = gtk.CellRendererPixbuf()
720
961
cell = gtk.CellRendererText()
721
tvcolumn_filename.pack_start(cellpb, False)
722
tvcolumn_filename.pack_start(cell, True)
723
tvcolumn_filename.set_attributes(cellpb, stock_id=0)
724
tvcolumn_filename.add_attribute(cell, 'text', 2)
725
tvcolumn_status.pack_start(cell, True)
726
tvcolumn_status.add_attribute(cell, 'text', 3)
727
tvcolumn_size.pack_start(cell, True)
728
tvcolumn_size.add_attribute(cell, 'text', 6)
729
tvcolumn_mtime.pack_start(cell, True)
730
tvcolumn_mtime.add_attribute(cell, 'text', 8)
962
self._tvcolumn_filename.pack_start(cellpb, False)
963
self._tvcolumn_filename.pack_start(cell, True)
964
self._tvcolumn_filename.set_attributes(cellpb, stock_id=0)
965
self._tvcolumn_filename.add_attribute(cell, 'text', 2)
966
self._tvcolumn_status.pack_start(cell, True)
967
self._tvcolumn_status.add_attribute(cell, 'text', 3)
968
self._tvcolumn_size.pack_start(cell, True)
969
self._tvcolumn_size.add_attribute(cell, 'text', 6)
970
self._tvcolumn_mtime.pack_start(cell, True)
971
self._tvcolumn_mtime.add_attribute(cell, 'text', 8)
732
973
# Set up the properties of the TreeView
733
974
self.treeview_right.set_headers_visible(True)
734
975
self.treeview_right.set_headers_clickable(True)
735
976
self.treeview_right.set_search_column(1)
736
tvcolumn_filename.set_resizable(True)
977
self._tvcolumn_filename.set_resizable(True)
978
self._tvcolumn_status.set_resizable(True)
979
self._tvcolumn_size.set_resizable(True)
980
self._tvcolumn_mtime.set_resizable(True)
738
982
liststore.set_sort_func(13, self._sort_filelist_callback, None)
739
983
liststore.set_sort_column_id(13, gtk.SORT_ASCENDING)
740
tvcolumn_filename.set_sort_column_id(13)
741
tvcolumn_status.set_sort_column_id(3)
742
tvcolumn_size.set_sort_column_id(5)
743
tvcolumn_mtime.set_sort_column_id(7)
984
self._tvcolumn_filename.set_sort_column_id(13)
985
self._tvcolumn_status.set_sort_column_id(3)
986
self._tvcolumn_size.set_sort_column_id(5)
987
self._tvcolumn_mtime.set_sort_column_id(7)
745
989
# Set sensitivity
746
990
self.set_sensitivity()
992
def get_selected_fileid(self):
993
""" Get the file_id of the selected file. """
994
treeselection = self.treeview_right.get_selection()
995
(model, iter) = treeselection.get_selected()
1000
return model.get_value(iter, 9)
748
1002
def get_selected_right(self):
749
1003
""" Get the selected filename. """
750
1004
treeselection = self.treeview_right.get_selection()
776
1030
def set_sensitivity(self):
777
1031
""" Set menu and toolbar sensitivity. """
778
self.menuitem_branch_init.set_sensitive(self.notbranch)
779
self.menuitem_branch_get.set_sensitive(self.notbranch)
780
self.menuitem_branch_checkout.set_sensitive(self.notbranch)
781
self.menuitem_branch_pull.set_sensitive(not self.notbranch)
782
self.menuitem_branch_push.set_sensitive(not self.notbranch)
783
self.menuitem_branch_revert.set_sensitive(not self.notbranch)
784
self.menuitem_branch_merge.set_sensitive(not self.notbranch)
785
self.menuitem_branch_commit.set_sensitive(not self.notbranch)
786
self.menuitem_branch_tags.set_sensitive(not self.notbranch)
787
self.menuitem_branch_status.set_sensitive(not self.notbranch)
788
self.menuitem_branch_missing.set_sensitive(not self.notbranch)
789
self.menuitem_branch_conflicts.set_sensitive(not self.notbranch)
790
self.menuitem_stats.set_sensitive(not self.notbranch)
791
self.menuitem_add_files.set_sensitive(not self.notbranch)
792
self.menuitem_remove_files.set_sensitive(not self.notbranch)
793
self.menuitem_file_make_directory.set_sensitive(not self.notbranch)
794
self.menuitem_file_rename.set_sensitive(not self.notbranch)
795
self.menuitem_file_move.set_sensitive(not self.notbranch)
796
self.menuitem_file_annotate.set_sensitive(not self.notbranch)
797
#self.menutoolbutton_diff.set_sensitive(True)
798
self.toolbutton_diff.set_sensitive(not self.notbranch)
799
self.toolbutton_log.set_sensitive(not self.notbranch)
800
self.toolbutton_commit.set_sensitive(not self.notbranch)
801
self.toolbutton_pull.set_sensitive(not self.notbranch)
802
self.toolbutton_push.set_sensitive(not self.notbranch)
1034
self.menuitem_branch_init.set_sensitive(self.notbranch)
1035
self.menuitem_branch_get.set_sensitive(self.notbranch)
1036
self.menuitem_branch_checkout.set_sensitive(self.notbranch)
1037
self.menuitem_branch_pull.set_sensitive(not self.notbranch)
1038
self.menuitem_branch_push.set_sensitive(not self.notbranch)
1039
self.menuitem_branch_revert.set_sensitive(not self.notbranch)
1040
self.menuitem_branch_merge.set_sensitive(not self.notbranch)
1041
self.menuitem_branch_commit.set_sensitive(not self.notbranch)
1042
self.menuitem_branch_tags.set_sensitive(not self.notbranch)
1043
self.menuitem_branch_status.set_sensitive(not self.notbranch)
1044
self.menuitem_branch_missing.set_sensitive(not self.notbranch)
1045
self.menuitem_branch_conflicts.set_sensitive(not self.notbranch)
1046
self.menuitem_stats.set_sensitive(not self.notbranch)
1047
self.menuitem_stats_diff.set_sensitive(not self.notbranch)
1048
self.menuitem_add_files.set_sensitive(not self.notbranch)
1049
self.menuitem_remove_files.set_sensitive(not self.notbranch)
1050
self.menuitem_file_make_directory.set_sensitive(not self.notbranch)
1051
self.menuitem_file_rename.set_sensitive(not self.notbranch)
1052
self.menuitem_file_move.set_sensitive(not self.notbranch)
1053
self.menuitem_file_annotate.set_sensitive(not self.notbranch)
1054
#self.menutoolbutton_diff.set_sensitive(True)
1055
self.toolbutton_diff.set_sensitive(not self.notbranch)
1056
self.toolbutton_log.set_sensitive(not self.notbranch)
1057
self.toolbutton_commit.set_sensitive(not self.notbranch)
1058
self.toolbutton_pull.set_sensitive(not self.notbranch)
1059
self.toolbutton_push.set_sensitive(not self.notbranch)
1062
self.menuitem_branch_init.set_sensitive(False)
1063
self.menuitem_branch_get.set_sensitive(True)
1064
self.menuitem_branch_checkout.set_sensitive(True)
1065
self.menuitem_branch_pull.set_sensitive(False)
1066
self.menuitem_branch_push.set_sensitive(False)
1067
self.menuitem_branch_revert.set_sensitive(False)
1068
self.menuitem_branch_merge.set_sensitive(False)
1069
self.menuitem_branch_commit.set_sensitive(False)
1070
self.menuitem_branch_tags.set_sensitive(True)
1071
self.menuitem_branch_status.set_sensitive(False)
1072
self.menuitem_branch_missing.set_sensitive(False)
1073
self.menuitem_branch_conflicts.set_sensitive(False)
1074
self.menuitem_stats.set_sensitive(True)
1075
self.menuitem_stats_diff.set_sensitive(False)
1076
self.menuitem_add_files.set_sensitive(False)
1077
self.menuitem_remove_files.set_sensitive(False)
1078
self.menuitem_file_make_directory.set_sensitive(False)
1079
self.menuitem_file_rename.set_sensitive(False)
1080
self.menuitem_file_move.set_sensitive(False)
1081
self.menuitem_file_annotate.set_sensitive(False)
1082
#self.menutoolbutton_diff.set_sensitive(True)
1083
self.toolbutton_diff.set_sensitive(False)
1084
self.toolbutton_log.set_sensitive(True)
1085
self.toolbutton_commit.set_sensitive(False)
1086
self.toolbutton_pull.set_sensitive(False)
1087
self.toolbutton_push.set_sensitive(False)
804
1089
def refresh_left(self):
805
1090
""" Refresh the bookmark list. """
829
1114
def refresh_right(self, path=None):
830
1115
""" Refresh the file list. """
831
from bzrlib.workingtree import WorkingTree
834
path = self.get_path()
836
# A workaround for double-clicking Bookmarks
837
if not os.path.exists(path):
840
# Get ListStore and clear it
841
liststore = self.treeview_right.get_model()
847
# Fill the appropriate lists
848
dotted_files = self.pref.get_preference('dotted_files', 'bool')
849
for item in os.listdir(path):
850
if not dotted_files and item[0] == '.':
852
if os.path.isdir(path + os.sep + item):
857
# Try to open the working tree
860
tree1 = WorkingTree.open_containing(path)[0]
861
except (bzrerrors.NotBranchError, bzrerrors.NoWorkingTree):
865
branch = tree1.branch
866
tree2 = tree1.branch.repository.revision_tree(branch.last_revision())
868
delta = tree1.changes_from(tree2, want_unchanged=True)
870
# Add'em to the ListStore
872
statinfo = os.stat(self.path + os.sep + item)
873
liststore.append([gtk.STOCK_DIRECTORY, True, item, '', '', statinfo.st_size, self._format_size(statinfo.st_size), statinfo.st_mtime, self._format_date(statinfo.st_mtime)])
1118
from bzrlib.workingtree import WorkingTree
1121
path = self.get_path()
1123
# A workaround for double-clicking Bookmarks
1124
if not os.path.exists(path):
1127
# Get ListStore and clear it
1128
liststore = self.treeview_right.get_model()
1131
# Show Status column
1132
self._tvcolumn_status.set_visible(True)
1137
# Fill the appropriate lists
1138
dotted_files = self.pref.get_preference('dotted_files', 'bool')
1139
for item in os.listdir(path):
1140
if not dotted_files and item[0] == '.':
1142
if os.path.isdir(path + os.sep + item):
1147
# Try to open the working tree
1150
tree1 = WorkingTree.open_containing(path)[0]
1151
except (bzrerrors.NotBranchError, bzrerrors.NoWorkingTree):
876
1154
if not notbranch:
877
filename = tree1.relpath(path + os.sep + item)
1155
branch = tree1.branch
1156
tree2 = tree1.branch.repository.revision_tree(branch.last_revision())
1158
delta = tree1.changes_from(tree2, want_unchanged=True)
1160
# Add'em to the ListStore
1162
statinfo = os.stat(self.path + os.sep + item)
1163
liststore.append([gtk.STOCK_DIRECTORY,
1169
self._format_size(statinfo.st_size),
1171
self._format_date(statinfo.st_mtime),
1177
filename = tree1.relpath(path + os.sep + item)
882
for rpath, rpathnew, id, kind, text_modified, meta_modified in delta.renamed:
883
if rpathnew == filename:
885
for rpath, id, kind in delta.added:
886
if rpath == filename:
888
for rpath, id, kind in delta.removed:
889
if rpath == filename:
891
for rpath, id, kind, text_modified, meta_modified in delta.modified:
892
if rpath == filename:
894
for rpath, id, kind in delta.unchanged:
895
if rpath == filename:
897
for rpath, file_class, kind, id, entry in self.wt.list_files():
898
if rpath == filename and file_class == 'I':
904
# status = fileops.status(path + os.sep + item)
905
#except errors.PermissionDenied:
908
if status == 'renamed':
910
elif status == 'removed':
912
elif status == 'added':
914
elif status == 'modified':
916
elif status == 'unchanged':
918
elif status == 'ignored':
923
statinfo = os.stat(self.path + os.sep + item)
924
liststore.append([gtk.STOCK_FILE, False, item, st, status, statinfo.st_size, self._format_size(statinfo.st_size), statinfo.st_mtime, self._format_date(statinfo.st_mtime)])
926
# Add the ListStore to the TreeView
927
self.treeview_right.set_model(liststore)
1182
for rpath, rpathnew, id, kind, text_modified, meta_modified in delta.renamed:
1183
if rpathnew == filename:
1186
for rpath, id, kind in delta.added:
1187
if rpath == filename:
1190
for rpath, id, kind in delta.removed:
1191
if rpath == filename:
1194
for rpath, id, kind, text_modified, meta_modified in delta.modified:
1195
if rpath == filename:
1198
for rpath, id, kind in delta.unchanged:
1199
if rpath == filename:
1200
status = 'unchanged'
1202
for rpath, file_class, kind, id, entry in self.wt.list_files():
1203
if rpath == filename and file_class == 'I':
1208
if status == 'renamed':
1210
elif status == 'removed':
1212
elif status == 'added':
1214
elif status == 'modified':
1216
elif status == 'unchanged':
1218
elif status == 'ignored':
1223
statinfo = os.stat(self.path + os.sep + item)
1224
liststore.append([gtk.STOCK_FILE,
1230
self._format_size(statinfo.st_size),
1232
self._format_date(statinfo.st_mtime),
1237
# Get ListStore and clear it
1238
liststore = self.treeview_right.get_model()
1241
# Hide Status column
1242
self._tvcolumn_status.set_visible(False)
1247
self._show_stock_image(gtk.STOCK_REFRESH)
1249
for (name, type) in self.remote_entries:
1250
if type.kind == 'directory':
1252
elif type.kind == 'file':
1256
""" Cache based on revision history. """
1257
def __init__(self, history):
1258
self._history = history
1260
def _lookup_revision(self, revid):
1261
for r in self._history:
1262
if r.revision_id == revid:
1264
rev = repo.get_revision(revid)
1265
self._history.append(rev)
1268
repo = self.remote_branch.repository
1270
revhistory = self.remote_branch.revision_history()
1272
revs = repo.get_revisions(revhistory)
1273
cache = HistoryCache(revs)
1274
except bzrerrors.InvalidHttpResponse:
1275
# Fallback to dummy algorithm, because of LP: #115209
1276
cache = HistoryCache([])
1279
if item.parent_id == self.remote_parent:
1280
rev = cache._lookup_revision(item.revision)
1281
liststore.append([ gtk.STOCK_DIRECTORY,
1287
self._format_size(0),
1289
self._format_date(rev.timestamp),
1292
while gtk.events_pending():
1293
gtk.main_iteration()
1296
if item.parent_id == self.remote_parent:
1297
rev = cache._lookup_revision(item.revision)
1298
liststore.append([ gtk.STOCK_FILE,
1304
self._format_size(item.text_size),
1306
self._format_date(rev.timestamp),
1309
while gtk.events_pending():
1310
gtk.main_iteration()
1312
self.image_location_error.destroy()
1314
# Columns should auto-size
928
1315
self.treeview_right.columns_autosize()
930
1317
# Set sensitivity