~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/changeset/serializer/v07.py

  • Committer: Aaron Bentley
  • Date: 2006-05-20 16:20:20 UTC
  • mto: This revision was merged to the branch mainline in revision 1738.
  • Revision ID: aaron.bentley@utoronto.ca-20060520162020-92eda5cfc69c6846
Start using a standard action writer

Show diffs side-by-side

added added

removed removed

Lines of Context:
163
163
        # Add an extra blank space at the end
164
164
        self.to_file.write('\n')
165
165
 
 
166
    def _write_action(self, name, parameters, properties=None):
 
167
        if properties is None:
 
168
            properties = []
 
169
        p_texts = ['%s:%s' % v for v in properties]
 
170
        self.to_file.write('=== ')
 
171
        self.to_file.write(' '.join([name]+parameters).encode('utf-8'))
 
172
        self.to_file.write(' // '.join(p_texts).encode('utf-8'))
 
173
        self.to_file.write('\n')
 
174
 
166
175
    def _write_delta(self, new_tree, old_tree, default_revision_id):
167
176
        """Write out the changes between the trees."""
168
177
        DEVNULL = '/dev/null'
210
219
            self.to_file.write(text.encode('utf-8'))
211
220
 
212
221
        for path, file_id, kind in delta.removed:
213
 
            w('=== removed %s %s\n' % (kind, path))
 
222
            self._write_action('removed', [kind, path])
214
223
 
215
224
        for path, file_id, kind in delta.added:
216
225
            w('=== added %s %s // file-id:%s' % (kind, path, file_id))