/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to commit.py

  • Committer: John Arbash Meinel
  • Date: 2007-10-01 20:03:50 UTC
  • mto: (322.1.1 trunk) (330.3.3 trunk)
  • mto: This revision was merged to the branch mainline in revision 368.
  • Revision ID: john@arbash-meinel.com-20071001200350-y4b9uh0rw5kjrfmf
Tests that we fill out the pending list correctly.
We should consider switching to a nested view. But that may
be unnecessary, since typically we only have 1 top level merge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
109
109
         self.setup_params()
110
110
         self.construct()
111
111
         self.set_default_size(800, 600)
 
112
         self.fill_in_data()
112
113
 
113
114
    def setup_params(self):
114
115
        """Setup the member variables for state."""
118
119
 
119
120
        self._is_checkout = (self._wt.branch.get_bound_location() is not None)
120
121
 
 
122
    def fill_in_data(self):
 
123
        # Now that we are built, handle changes to the view based on the state
 
124
        self._fill_in_pending()
 
125
 
 
126
    def _fill_in_pending(self):
 
127
        if not self._pending:
 
128
            self._pending_box.hide()
 
129
            return
 
130
 
 
131
        # TODO: We'd really prefer this to be a nested list
 
132
        for rev, children in self._pending:
 
133
            rev_info = self._rev_to_pending_info(rev)
 
134
            self._pending_liststore.append([
 
135
                rev_info['revision_id'],
 
136
                rev_info['date'],
 
137
                rev_info['committer'],
 
138
                rev_info['summary'],
 
139
                ])
 
140
            for child in children:
 
141
                rev_info = self._rev_to_pending_info(child)
 
142
                self._pending_liststore.append([
 
143
                    rev_info['revision_id'],
 
144
                    rev_info['date'],
 
145
                    rev_info['committer'],
 
146
                    rev_info['summary'],
 
147
                    ])
 
148
        self._pending_box.show()
 
149
 
121
150
    def _compute_delta(self):
122
151
        self._delta = self._wt.changes_from(self._basis_tree)
123
152
 
139
168
        self._construct_file_list()
140
169
        self._construct_pending_list()
141
170
 
142
 
        self._pending_box.show()
143
171
        self._hpane.pack1(self._left_pane_box, resize=False, shrink=True)
144
172
        self._left_pane_box.show()
145
173
 
203
231
        self._pending_box = gtk.VBox()
204
232
        self._pending_box.hide()
205
233
 
206
 
        # TODO: This message should be centered
207
234
        pending_message = gtk.Label()
208
235
        pending_message.set_markup(
209
236
            _('<i>Cannot select specific files when merging</i>'))
226
253
        self._treeview_pending.show()
227
254
        self._left_pane_box.pack_start(self._pending_box)
228
255
 
 
256
        liststore = gtk.ListStore(gobject.TYPE_STRING,
 
257
                                  gobject.TYPE_STRING,
 
258
                                  gobject.TYPE_STRING,
 
259
                                  gobject.TYPE_STRING,
 
260
                                 )
 
261
        self._pending_liststore = liststore
 
262
        self._treeview_pending.set_model(liststore)
 
263
        self._treeview_pending.append_column(gtk.TreeViewColumn(_('Date'),
 
264
                                             gtk.CellRendererText(), text=1))
 
265
        self._treeview_pending.append_column(gtk.TreeViewColumn(_('Committer'),
 
266
                                             gtk.CellRendererText(), text=2))
 
267
        self._treeview_pending.append_column(gtk.TreeViewColumn(_('Summary'),
 
268
                                             gtk.CellRendererText(), text=3))
 
269
 
229
270
    def _construct_diff_view(self):
230
271
        from diff import DiffView
231
272