~ubuntu-branches/debian/jessie/bzr-git/jessie

« back to all changes in this revision

Viewing changes to fetch.py

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2011-08-07 15:43:09 UTC
  • mfrom: (1.1.20 upstream)
  • Revision ID: james.westby@ubuntu.com-20110807154309-3jroa5x6mehtf87h
Tags: 0.6.2-1
* New upstream release.
 + Depends on Dulwich 0.8.0.
 + Implements per_file_graph. LP: #677363

Show diffs side-by-side

added added

removed removed

Lines of Context:
154
154
        assert ie.revision is not None
155
155
        if ie.kind == 'symlink':
156
156
            chunks = []
157
 
        else: 
 
157
        else:
158
158
            chunks = blob.chunked
159
159
        texts.insert_record_stream([
160
160
            ChunkedContentFactory((file_id, ie.revision),
502
502
        def determine_wants(refs):
503
503
            potential = set(wants)
504
504
            if include_tags:
505
 
                potential.update([v[1] or v[0] for v in extract_tags(refs).itervalues()])
 
505
                potential.update(
 
506
                    [v[1] or v[0] for v in extract_tags(refs).itervalues()])
506
507
            return list(potential - self._target_has_shas(potential))
507
508
        return determine_wants
508
509
 
509
510
    def determine_wants_all(self, refs):
510
 
        potential = set([sha for (ref, sha) in refs.iteritems() if not ref.endswith("^{}")])
 
511
        potential = set([sha for (ref, sha) in refs.iteritems() if not
 
512
            ref.endswith("^{}")])
511
513
        return list(potential - self._target_has_shas(potential))
512
514
 
513
515
    @staticmethod
556
558
            if recipe[0] in ("search", "proxy-search"):
557
559
                interesting_heads = recipe[1]
558
560
            else:
559
 
                raise AssertionError("Unsupported search result type %s" % recipe[0])
 
561
                raise AssertionError("Unsupported search result type %s" %
 
562
                        recipe[0])
560
563
        else:
561
564
            interesting_heads = None
562
565
 
629
632
                objects_iter = self.source.fetch_objects(
630
633
                    wants_recorder, graph_walker, store.get_raw,
631
634
                    progress)
632
 
                trace.mutter("Importing %d new revisions", len(wants_recorder.wants))
633
 
                (pack_hint, last_rev) = import_git_objects(self.target, mapping,
634
 
                    objects_iter, store, wants_recorder.wants, pb, limit)
 
635
                trace.mutter("Importing %d new revisions",
 
636
                             len(wants_recorder.wants))
 
637
                (pack_hint, last_rev) = import_git_objects(self.target,
 
638
                    mapping, objects_iter, store, wants_recorder.wants, pb,
 
639
                    limit)
635
640
                return (pack_hint, last_rev, wants_recorder.remote_refs)
636
641
            finally:
637
642
                if create_pb:
668
673
        try:
669
674
            target_git_object_retriever.lock_write()
670
675
            try:
671
 
                (pack_hint, last_rev) = import_git_objects(self.target, mapping,
672
 
                    self.source._git.object_store,
 
676
                (pack_hint, last_rev) = import_git_objects(self.target,
 
677
                    mapping, self.source._git.object_store,
673
678
                    target_git_object_retriever, wants, pb, limit)
674
679
                return (pack_hint, last_rev, remote_refs)
675
680
            finally: