~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/fetch.py

  • Committer: Martin Packman
  • Date: 2012-01-05 10:37:58 UTC
  • mto: This revision was merged to the branch mainline in revision 6427.
  • Revision ID: martin.packman@canonical.com-20120105103758-wzftnmsip5iv9n2g
Revert addition of get_message_encoding function

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
from bzrlib.lazy_import import lazy_import
29
29
lazy_import(globals(), """
30
30
from bzrlib import (
31
 
    graph as _mod_graph,
32
31
    tsort,
33
32
    versionedfile,
 
33
    vf_search,
34
34
    )
35
35
""")
36
36
from bzrlib import (
37
37
    errors,
38
38
    ui,
39
39
    )
 
40
from bzrlib.i18n import gettext
40
41
from bzrlib.revision import NULL_REVISION
41
42
from bzrlib.trace import mutter
42
43
 
93
94
        pb = ui.ui_factory.nested_progress_bar()
94
95
        pb.show_pct = pb.show_count = False
95
96
        try:
96
 
            pb.update("Finding revisions", 0, 2)
 
97
            pb.update(gettext("Finding revisions"), 0, 2)
97
98
            search_result = self._revids_to_fetch()
98
99
            mutter('fetching: %s', search_result)
99
100
            if search_result.is_empty():
100
101
                return
101
 
            pb.update("Fetching revisions", 1, 2)
 
102
            pb.update(gettext("Fetching revisions"), 1, 2)
102
103
            self._fetch_everything_for_search(search_result)
103
104
        finally:
104
105
            pb.finished()
160
161
        elif self._last_revision == NULL_REVISION:
161
162
            # fetch_spec is None + last_revision is null => empty fetch.
162
163
            # explicit limit of no revisions needed
163
 
            return _mod_graph.EmptySearchResult()
 
164
            return vf_search.EmptySearchResult()
164
165
        elif self._last_revision is not None:
165
 
            return _mod_graph.NotInOtherForRevs(self.to_repository,
 
166
            return vf_search.NotInOtherForRevs(self.to_repository,
166
167
                self.from_repository, [self._last_revision],
167
168
                find_ghosts=self.find_ghosts).execute()
168
169
        else: # self._last_revision is None:
169
 
            return _mod_graph.EverythingNotInOther(self.to_repository,
 
170
            return vf_search.EverythingNotInOther(self.to_repository,
170
171
                self.from_repository,
171
172
                find_ghosts=self.find_ghosts).execute()
172
173
 
388
389
                    "limit is only supported with a source branch set")
389
390
            # Caller hasn't specified any revisions or source branch
390
391
            if self.target_repo_kind == TargetRepoKinds.EMPTY:
391
 
                return _mod_graph.EverythingResult(self.source_repo)
 
392
                return vf_search.EverythingResult(self.source_repo)
392
393
            else:
393
394
                # We want everything not already in the target (or target's
394
395
                # fallbacks).
395
 
                return _mod_graph.EverythingNotInOther(
 
396
                return vf_search.EverythingNotInOther(
396
397
                    self.target_repo, self.source_repo).execute()
397
398
        heads_to_fetch = set(self._explicit_rev_ids)
398
399
        if self.source_branch is not None:
415
416
            # heads_to_fetch will almost certainly be present so this doesn't
416
417
            # matter much.
417
418
            all_heads = heads_to_fetch.union(if_present_fetch)
418
 
            ret = _mod_graph.PendingAncestryResult(all_heads, self.source_repo)
 
419
            ret = vf_search.PendingAncestryResult(all_heads, self.source_repo)
419
420
            if self.limit is not None:
420
421
                graph = self.source_repo.get_graph()
421
422
                topo_order = list(graph.iter_topo_order(ret.get_keys()))
423
424
                ret = self.source_repo.revision_ids_to_search_result(result_set)
424
425
            return ret
425
426
        else:
426
 
            return _mod_graph.NotInOtherForRevs(self.target_repo, self.source_repo,
 
427
            return vf_search.NotInOtherForRevs(self.target_repo, self.source_repo,
427
428
                required_ids=heads_to_fetch, if_present_ids=if_present_fetch,
428
429
                limit=self.limit).execute()