~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to fetch_ghosts.py

  • Committer: Aaron Bentley
  • Date: 2005-10-07 16:00:48 UTC
  • Revision ID: abentley@panoramicfeedback.com-20051007160048-0b21cda18524618a
Renamed fetch-missing to fetch-ghosts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
from bzrlib.branch import Branch
17
17
from bzrlib.fetch import greedy_fetch
18
18
from bzrlib.errors import NoSuchRevision, InstallFailed
19
 
def fetch_missing(branch):
20
 
    """Install the revisions of missing ancestors from another branch."""
 
19
def fetch_ghosts(branch):
 
20
    """Install ghosts from copies in another branch."""
21
21
    this_branch = Branch.open_containing('.')
22
22
    if branch is None:
23
23
        branch = this_branch.get_parent()
26
26
    installed = []
27
27
    failed = []
28
28
 
29
 
    # Because iter_missing_ancestors tests for existence after our last fetch
30
 
    # is complete, it won't falsely report an ancestor as missing.
 
29
    # Because iter_ghosts tests for existence after our last fetch
 
30
    # is complete, it won't falsely report an ancestor as a ghost.
31
31
    # Yay iterators!
32
 
    missing = iter_missing_ancestors(this_branch)
33
 
    for revision in missing:
 
32
    ghosts = iter_ghosts(this_branch)
 
33
    for revision in ghosts:
34
34
        try:
35
35
            greedy_fetch(this_branch, other_branch, revision)
36
36
            installed.append(revision)
45
45
    for rev in failed:
46
46
        print rev
47
47
 
48
 
def iter_missing_ancestors(branch):
 
48
def iter_ghosts(branch):
49
49
    """Find all ancestors that aren't stored in this branch."""
50
50
    seen = set()
51
51
    lines = [branch.last_revision()]