/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 olive/commit.py

  • Committer: Alexander Belchenko
  • Date: 2006-10-26 07:49:27 UTC
  • mto: (91.1.8 trunk) (66.2.10 trunk)
  • mto: This revision was merged to the branch mainline in revision 107.
  • Revision ID: bialix@ukr.net-20061026074927-7011f495b559b654
Fix bug introduced by revid:bialix@ukr.net-20061025102040-90bcdbad341ee3fa

Commit dialog should store real file name of renamed items,
otherwise commit fails with error (File not versioned a => b)

Fixed by using extra hidden column in file_store.
Also for renamed *and* modified items show correct type of changes
as 'renamed and modified'

Show diffs side-by-side

added added

removed removed

Lines of Context:
109
109
            
110
110
    
111
111
    def _create_file_view(self):
112
 
        self.file_store = gtk.ListStore(gobject.TYPE_BOOLEAN,
113
 
                                        gobject.TYPE_STRING,
114
 
                                        gobject.TYPE_STRING)
 
112
        self.file_store = gtk.ListStore(gobject.TYPE_BOOLEAN,   # [0] checkbox
 
113
                                        gobject.TYPE_STRING,    # [1] path to display
 
114
                                        gobject.TYPE_STRING,    # [2] changes type
 
115
                                        gobject.TYPE_STRING)    # [3] real path
115
116
        self.file_view.set_model(self.file_store)
116
117
        crt = gtk.CellRendererToggle()
117
118
        crt.set_property("activatable", True)
125
126
 
126
127
        for path, id, kind in self.delta.added:
127
128
            marker = osutils.kind_marker(kind)
128
 
            self.file_store.append([ True, path+marker, _('added') ])
 
129
            self.file_store.append([ True, path+marker, _('added'), path ])
129
130
 
130
131
        for path, id, kind in self.delta.removed:
131
132
            marker = osutils.kind_marker(kind)
132
 
            self.file_store.append([ True, path+marker, _('removed') ])
 
133
            self.file_store.append([ True, path+marker, _('removed'), path ])
133
134
 
134
135
        for oldpath, newpath, id, kind, text_modified, meta_modified in self.delta.renamed:
135
136
            marker = osutils.kind_marker(kind)
 
137
            if text_modified or meta_modified:
 
138
                changes = _('renamed and modified')
 
139
            else:
 
140
                changes = _('renamed')
136
141
            self.file_store.append([ True,
137
142
                                     oldpath+marker + '  =>  ' + newpath+marker,
138
 
                                     _('renamed') ])
 
143
                                     changes,
 
144
                                     newpath
 
145
                                   ])
139
146
 
140
147
        for path, id, kind, text_modified, meta_modified in self.delta.modified:
141
148
            marker = osutils.kind_marker(kind)
142
 
            self.file_store.append([ True, path+marker, _('modified') ])
 
149
            self.file_store.append([ True, path+marker, _('modified'), path ])
143
150
    
144
151
    def _create_pending_merges(self):
145
152
        liststore = gtk.ListStore(gobject.TYPE_STRING,
167
174
        it = self.file_store.get_iter_first()
168
175
        while it:
169
176
            if self.file_store.get_value(it, 0):
170
 
                ret.append(self.file_store.get_value(it, 1))
 
177
                # get real path from hidden column 3
 
178
                ret.append(self.file_store.get_value(it, 3))
171
179
            it = self.file_store.iter_next(it)
172
180
 
173
181
        return ret