~jelmer/dulwich/lp-pqm

« back to all changes in this revision

Viewing changes to dulwich/object_store.py

  • Committer: Jelmer Vernooij
  • Date: 2012-02-01 22:13:51 UTC
  • mfrom: (413.11.554)
  • Revision ID: jelmer@samba.org-20120201221351-b3n2p9zttzh62dwu
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
132
132
    def tree_changes(self, source, target, want_unchanged=False):
133
133
        """Find the differences between the contents of two trees
134
134
 
135
 
        :param object_store: Object store to use for retrieving tree contents
136
 
        :param tree: SHA1 of the root tree
 
135
        :param source: SHA1 of the source tree
 
136
        :param target: SHA1 of the target tree
137
137
        :param want_unchanged: Whether unchanged files should be reported
138
138
        :return: Iterator over tuples with
139
139
            (oldpath, newpath), (oldmode, newmode), (oldsha, newsha)
471
471
        f.seek(0)
472
472
        write_pack_header(f, len(entries) + len(indexer.ext_refs()))
473
473
 
 
474
        # Must flush before reading (http://bugs.python.org/issue3207)
 
475
        f.flush()
 
476
 
474
477
        # Rescan the rest of the pack, computing the SHA with the new header.
475
478
        new_sha = compute_file_sha(f, end_ofs=-20)
476
479
 
 
480
        # Must reposition before writing (http://bugs.python.org/issue3207)
 
481
        f.seek(0, os.SEEK_CUR)
 
482
 
477
483
        # Complete the pack.
478
484
        for ext_sha in indexer.ext_refs():
479
485
            assert len(ext_sha) == 20