14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
19
pygtk.require("2.0")
33
import bzrlib.errors as errors
35
if bzrlib.version_info < (0, 9):
36
# function deprecated after 0.9
37
from bzrlib.delta import compare_trees
39
from bzrlib.status import show_tree_status
40
from bzrlib.workingtree import WorkingTree
42
from dialog import OliveDialog
26
from olive import gladefile
45
29
""" Display Status window and perform the needed actions. """
46
def __init__(self, gladefile, comm, dialog):
30
def __init__(self, wt, wtpath):
47
31
""" Initialize the Status window. """
48
self.gladefile = gladefile
49
self.glade = gtk.glade.XML(self.gladefile, 'window_status')
51
# Communication object
32
self.glade = gtk.glade.XML(gladefile, 'window_status')
56
34
# Get the Status window widget
57
35
self.window = self.glade.get_widget('window_status')
59
40
# Check if current location is a branch
61
(self.wt, path) = WorkingTree.open_containing(self.comm.get_path())
62
branch = self.wt.branch
63
except errors.NotBranchError:
69
file_id = self.wt.path2id(path)
41
file_id = self.wt.path2id(wtpath)
71
self.notbranch = False
76
43
# Set the old working tree
77
44
self.old_tree = self.wt.branch.repository.revision_tree(self.wt.branch.last_revision())
98
65
column.add_attribute(cell, "text", 0)
99
66
self.treeview.append_column(column)
101
if bzrlib.version_info < (0, 9):
102
delta = compare_trees(self.old_tree, self.wt)
104
delta = self.wt.changes_from(self.old_tree)
68
delta = self.wt.changes_from(self.old_tree)
146
110
def display(self):
147
111
""" Display the Diff window. """
149
self.dialog.error_dialog(_('Directory is not a branch'),
150
_('You can perform this action only in a branch.'))
153
self.window.show_all()
112
self.window.show_all()
155
114
def close(self, widget=None):
156
115
self.window.destroy()