~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/revisionspec.py

(mbp) merge bzr.dev to 0.8, prepare for release

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
        # TODO: otherwise, it should depend on how I was built -
58
58
        # if it's in_history(branch), then check revision_history(),
59
59
        # if it's in_store(branch), do the check below
60
 
        return self.branch.revision_store.has_id(self.rev_id)
 
60
        return self.branch.repository.has_revision(self.rev_id)
61
61
 
62
62
    def __len__(self):
63
63
        return 2
68
68
        raise IndexError(index)
69
69
 
70
70
    def get(self):
71
 
        return self.branch.get_revision(self.rev_id)
 
71
        return self.branch.repository.get_revision(self.rev_id)
72
72
 
73
73
    def __eq__(self, other):
74
74
        if type(other) not in (tuple, list, type(self)):
204
204
        try:
205
205
            return RevisionInfo(branch, revs.index(self.spec) + 1, self.spec)
206
206
        except ValueError:
207
 
            return RevisionInfo(branch, None)
 
207
            return RevisionInfo(branch, None, self.spec)
208
208
 
209
209
SPEC_TYPES.append(RevisionSpec_revid)
210
210
 
297
297
                    hour=hour, minute=minute, second=second)
298
298
        first = dt
299
299
        for i in range(len(revs)):
300
 
            r = branch.get_revision(revs[i])
 
300
            r = branch.repository.get_revision(revs[i])
301
301
            # TODO: Handle timezone.
302
302
            dt = datetime.datetime.fromtimestamp(r.timestamp)
303
303
            if first <= dt:
319
319
        for r, b in ((revision_a, branch), (revision_b, other_branch)):
320
320
            if r is None:
321
321
                raise NoCommits(b)
322
 
        revision_source = MultipleRevisionSources(branch, other_branch)
 
322
        revision_source = MultipleRevisionSources(branch.repository,
 
323
                                                  other_branch.repository)
323
324
        rev_id = common_ancestor(revision_a, revision_b, revision_source)
324
325
        try:
325
326
            revno = branch.revision_id_to_revno(rev_id)
338
339
 
339
340
    def _match_on(self, branch, revs):
340
341
        from branch import Branch
341
 
        from fetch import greedy_fetch
342
342
        other_branch = Branch.open_containing(self.spec)[0]
343
343
        revision_b = other_branch.last_revision()
344
344
        if revision_b is None:
345
345
            raise NoCommits(other_branch)
346
346
        # pull in the remote revisions so we can diff
347
 
        greedy_fetch(branch, other_branch, revision=revision_b)
 
347
        branch.fetch(other_branch, revision_b)
348
348
        try:
349
349
            revno = branch.revision_id_to_revno(revision_b)
350
350
        except NoSuchRevision: