~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/revisionspec.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-02-18 02:33:47 UTC
  • mfrom: (1534.1.24 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20060218023347-0952c65f668bfd68
Merge Robert Collins integration.

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.rev_id in self.branch.revision_store
 
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:
313
313
    def _match_on(self, branch, revs):
314
314
        from branch import Branch
315
315
        from revision import common_ancestor, MultipleRevisionSources
316
 
        other_branch = Branch.open_containing(self.spec)
 
316
        other_branch = Branch.open_containing(self.spec)[0]
317
317
        revision_a = branch.last_revision()
318
318
        revision_b = other_branch.last_revision()
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)
339
340
    def _match_on(self, branch, revs):
340
341
        from branch import Branch
341
342
        from fetch import greedy_fetch
342
 
        other_branch = Branch.open_containing(self.spec)
 
343
        other_branch = Branch.open_containing(self.spec)[0]
343
344
        revision_b = other_branch.last_revision()
344
345
        if revision_b is None:
345
346
            raise NoCommits(other_branch)