/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-09 23:36:13 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-20071009233613-gerfa0rwn7tklvzd
Only enable the per-file dialog if 'per_file_commits' is enabled in the config.

Show diffs side-by-side

added added

removed removed

Lines of Context:
108
108
 
109
109
        self._wt = wt
110
110
        self._selected = selected
 
111
        self._enable_per_file_commits = True
111
112
        self.committed_revision_id = None # Nothing has been committed yet
112
113
 
113
114
        self.setup_params()
128
129
        self._fill_in_diff()
129
130
        self._fill_in_files()
130
131
        self._fill_in_checkout()
 
132
        self._fill_in_per_file_info()
131
133
 
132
134
    def _fill_in_pending(self):
133
135
        if not self._pending:
222
224
                mutter("unable to get networkmanager state: %r" % e)
223
225
        self._check_local.show()
224
226
 
 
227
    def _fill_in_per_file_info(self):
 
228
        config = self._wt.branch.get_config()
 
229
        enable_per_file_commits = config.get_user_option('per_file_commits')
 
230
        if (enable_per_file_commits is None
 
231
            or enable_per_file_commits.lower()
 
232
                not in ('y', 'yes', 'on', 'enable', '1', 't', 'true')):
 
233
            self._enable_per_file_commits = False
 
234
        else:
 
235
            self._enable_per_file_commits = True
 
236
        if not self._enable_per_file_commits:
 
237
            self._file_message_expander.hide()
 
238
 
225
239
    def _compute_delta(self):
226
240
        self._delta = self._wt.changes_from(self._basis_tree)
227
241
 
517
531
 
518
532
    def _update_per_file_info(self, selection):
519
533
        # The node is changing, so cache the current message
 
534
        if not self._enable_per_file_commits:
 
535
            return
 
536
 
520
537
        self._save_current_file_message()
521
538
        text_buffer = self._file_message_text_view.get_buffer()
522
539
        file_id, display_path, message = self._files_store.get(selection, 0, 3, 5)
552
569
                path = record[1]    # [1] real path
553
570
                file_message = record[5] # [5] commit message
554
571
                files.append(path.decode('UTF-8'))
555
 
                if file_message:
 
572
                if self._enable_per_file_commits and file_message:
556
573
                    # All of this needs to be utf-8 information
557
574
                    file_info.append({'path':path, 'file_id':file_id,
558
575
                                     'message':file_message})
559
576
        file_info.sort(key=lambda x:(x['path'], x['file_id']))
560
 
        return files, file_info
 
577
        if self._enable_per_file_commits:
 
578
            return files, file_info
 
579
        else:
 
580
            return files, []
561
581
 
562
582
    @show_bzr_error
563
583
    def _on_commit_clicked(self, button):