154
154
self._pending_box.show()
156
156
def _fill_in_files(self):
157
# We should really use _iter_changes, and then add a progress bar of
157
# We should really use add a progress bar of some kind.
159
158
# While we fill in the view, hide the store
160
159
store = self._files_store
161
160
self._treeview_files.set_model(None)
180
179
self._wt.lock_read()
181
180
self._basis_tree.lock_read()
183
for (file_id, paths, changed_content, versioned, parent_ids, names,
184
kinds, executables) in self._wt._iter_changes(self._basis_tree):
186
# Skip the root entry.
187
if parent_ids == (None, None):
194
source_marker = osutils.kind_marker(kinds[0])
196
assert kinds[0] is not None
197
marker = osutils.kind_marker(kinds[0])
199
marker = osutils.kind_marker(kinds[1])
202
if real_path is None:
204
assert real_path is not None
205
display_path = real_path + marker
207
present_source = versioned[0] and kinds[0] is not None
208
present_target = versioned[1] and kinds[1] is not None
210
if present_source != present_target:
214
change_type = removed
215
elif names[0] != names[1] or parent_ids[0] != parent_ids[1]:
217
if changed_content or executables[0] != executables[1]:
219
change_type = renamed_and_modified
221
change_type = renamed
222
display_path = (paths[0] + source_marker
223
+ ' => ' + paths[1] + marker)
224
elif kinds[0] != kinds[1]:
225
change_type = kind_changed
226
display_path = (paths[0] + source_marker
227
+ ' => ' + paths[1] + marker)
228
elif changed_content is True or executables[0] != executables[1]:
229
change_type = modified
231
assert False, "How did we get here?"
233
store.append([file_id, real_path, True, display_path,
182
from diff import _iter_changes_to_status
183
for (file_id, real_path, change_type, display_path
184
) in _iter_changes_to_status(self._basis_tree, self._wt):
185
store.append([file_id, real_path.encode('UTF-8'),
186
True, display_path.encode('UTF-8'),
234
187
change_type, ''])
236
189
self._basis_tree.unlock()
511
464
self._diff_view.show_diff(None)
513
self._diff_view.show_diff([path])
466
self._diff_view.show_diff([path.decode('UTF-8')])
514
467
self._update_per_file_info(selection)
516
469
def _save_current_file_message(self):
552
505
for record in records:
553
506
if record[2]: # [2] checkbox
556
file_message = record[5]
557
files.append(record[1]) # [1] real path
507
file_id = record[0] # [0] file_id
508
path = record[1] # [1] real path
509
file_message = record[5] # [5] commit message
510
files.append(path.decode('UTF-8'))
512
# All of this needs to be utf-8 information
559
513
file_info.append({'path':path, 'file_id':file_id,
560
514
'message':file_message})
561
515
file_info.sort(key=lambda x:(x['path'], x['file_id']))
631
585
def _set_global_commit_message(self, message):
632
586
"""Just a helper for the test suite."""
587
if isinstance(message, unicode):
588
message = message.encode('UTF-8')
633
589
self._global_message_text_view.get_buffer().set_text(message)
635
591
def _set_file_commit_message(self, message):
636
592
"""Helper for the test suite."""
593
if isinstance(message, unicode):
594
message = message.encode('UTF-8')
637
595
self._file_message_text_view.get_buffer().set_text(message)