~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Martin Pool
  • Date: 2005-09-15 08:43:31 UTC
  • Revision ID: mbp@sourcefrog.net-20050915084331-468708d17b8d72e1
- new method Branch.has_revision

- fetch checks this before copying a revision

- update Branch.update_revisions

Show diffs side-by-side

added added

removed removed

Lines of Context:
583
583
            f.close()
584
584
 
585
585
 
 
586
    def has_revision(self, revision_id):
 
587
        """True if this branch has a copy of the revision.
 
588
 
 
589
        This does not necessarily imply the revision is merge
 
590
        or on the mainline."""
 
591
        return revision_id in self.revision_store
 
592
 
 
593
 
586
594
    def get_revision_xml_file(self, revision_id):
587
595
        """Return XML file object for revision object."""
588
596
        if not revision_id or not isinstance(revision_id, basestring):
821
829
        from bzrlib.fetch import greedy_fetch
822
830
 
823
831
        greedy_fetch(to_branch=self, from_branch=other,
824
 
                     revision_limit=stop_revision)
825
 
 
826
 
        revision_ids = self.missing_revisions(other, stop_revision)
827
 
 
828
 
        if len(revision_ids) > 0:
829
 
            count = greedy_fetch(self, other, revision_ids[-1], pb)[0]
830
 
        else:
831
 
            count = 0
832
 
        self.append_revision(*revision_ids)
 
832
                     revision=stop_revision)
 
833
 
 
834
        pullable_revs = self.missing_revisions(other, stop_revision)
 
835
 
 
836
        if pullable_revs:
 
837
            greedy_fetch(to_branch=self,
 
838
                         from_branch=other,
 
839
                         revision=pullable_revs[-1])
 
840
            self.append_revision(*pullable_revs)
833
841
 
834
842
 
835
843
    def commit(self, *args, **kw):