~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: John Arbash Meinel
  • Date: 2005-12-31 20:55:42 UTC
  • mto: (1185.82.108 w-changeset)
  • mto: This revision was merged to the branch mainline in revision 1738.
  • Revision ID: john@arbash-meinel.com-20051231205542-af053340b79f72a5
Adding patches.py into bzrlib, including the tests into the test suite.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
from sha import sha
27
27
from bzrlib.diff import internal_diff
28
28
from bzrlib.delta import compare_trees
 
29
from bzrlib.rio import RioWriter, read_stanzas
 
30
from bzrlib.osutils import pathjoin
29
31
 
30
32
 
31
33
class ChangesetSerializerV06(ChangesetSerializer):
153
155
        old_label = ''
154
156
        new_label = ''
155
157
 
156
 
        def pjoin(*args):
157
 
            # Only forward slashes in changesets
158
 
            return os.path.join(*args).replace('\\', '/')
159
 
 
160
158
        def do_diff(old_path, file_id, new_path, kind):
161
159
            new_entry = new_tree.inventory[file_id]
162
160
            old_tree.inventory[file_id].diff(internal_diff,
163
 
                    pjoin(old_label, old_path), old_tree,
164
 
                    pjoin(new_label, new_path), new_entry, new_tree,
 
161
                    pathjoin(old_label, old_path), old_tree,
 
162
                    pathjoin(new_label, new_path), new_entry, new_tree,
165
163
                    self.to_file)
166
164
        def do_meta(file_id):
167
165
            ie = new_tree.inventory[file_id]
182
180
        for path, file_id, kind in delta.added:
183
181
            w('=== added %s %s // file-id:%s\n' % (kind, path, file_id))
184
182
            new_tree.inventory[file_id].diff(internal_diff,
185
 
                    pjoin(new_label, path), new_tree,
 
183
                    pathjoin(new_label, path), new_tree,
186
184
                    DEVNULL, None, None,
187
185
                    self.to_file, reverse=True)
188
186