/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Martin Pool
  • Date: 2007-08-17 05:01:28 UTC
  • mto: (2696.3.9 default-format)
  • mto: This revision was merged to the branch mainline in revision 2722.
  • Revision ID: mbp@sourcefrog.net-20070817050128-phk7x1enjqhio5mu
Kill off append_revision

Show diffs side-by-side

added added

removed removed

Lines of Context:
377
377
        """Print `file` to stdout."""
378
378
        raise NotImplementedError(self.print_file)
379
379
 
380
 
    @deprecated_method(zero_ninetyone)
381
 
    def append_revision(self, *revision_ids):
382
 
        """Add a revision to the tip of this branch.
383
 
 
384
 
        This method is deprecated, use set_last_revision_info instead.
385
 
        """
386
 
        raise NotImplementedError(self.append_revision)
387
 
 
388
380
    def set_revision_history(self, rev_history):
389
381
        raise NotImplementedError(self.set_revision_history)
390
382
 
1372
1364
        """See Branch.print_file."""
1373
1365
        return self.repository.print_file(file, revision_id)
1374
1366
 
1375
 
    @deprecated_method(zero_ninetyone)
1376
 
    @needs_write_lock
1377
 
    def append_revision(self, *revision_ids):
1378
 
        """See Branch.append_revision."""
1379
 
        revision_ids = [osutils.safe_revision_id(r) for r in revision_ids]
1380
 
        for revision_id in revision_ids:
1381
 
            _mod_revision.check_not_reserved_id(revision_id)
1382
 
            mutter("add {%s} to revision-history" % revision_id)
1383
 
        rev_history = self.revision_history()
1384
 
        rev_history.extend(revision_ids)
1385
 
        self.set_revision_history(rev_history)
1386
 
 
1387
1367
    def _write_revision_history(self, history):
1388
1368
        """Factored out of set_revision_history.
1389
1369
 
1415
1395
        be permitted.
1416
1396
        """
1417
1397
        revision_id = osutils.safe_revision_id(revision_id)
1418
 
        # this check is disabled because the caller is required to make sure 
1419
 
        # they match, and it's useful for testing that we can set branches to
1420
 
        # revisions they cannot reconstruct.
1421
 
        ## history = self._lefthand_history(revision_id)
1422
 
        ##assert len(history) == revno, '%d != %d' % (len(history), revno)
 
1398
        history = self._lefthand_history(revision_id)
 
1399
        assert len(history) == revno, '%d != %d' % (len(history), revno)
1423
1400
        self.set_revision_history(history)
1424
1401
 
1425
1402
    def _gen_revision_history(self):
2019
1996
            self._check_history_violation(last_revision)
2020
1997
        self._write_last_revision_info(len(history), last_revision)
2021
1998
 
2022
 
    @deprecated_method(zero_ninetyone)
2023
 
    @needs_write_lock
2024
 
    def append_revision(self, *revision_ids):
2025
 
        revision_ids = [osutils.safe_revision_id(r) for r in revision_ids]
2026
 
        if len(revision_ids) == 0:
2027
 
            return
2028
 
        prev_revno, prev_revision = self.last_revision_info()
2029
 
        for revision in self.repository.get_revisions(revision_ids):
2030
 
            if prev_revision == _mod_revision.NULL_REVISION:
2031
 
                if revision.parent_ids != []:
2032
 
                    raise errors.NotLeftParentDescendant(self, prev_revision,
2033
 
                                                         revision.revision_id)
2034
 
            else:
2035
 
                if revision.parent_ids[0] != prev_revision:
2036
 
                    raise errors.NotLeftParentDescendant(self, prev_revision,
2037
 
                                                         revision.revision_id)
2038
 
            prev_revision = revision.revision_id
2039
 
        self.set_last_revision_info(prev_revno + len(revision_ids),
2040
 
                                    revision_ids[-1])
2041
 
 
2042
1999
    @needs_write_lock
2043
2000
    def _set_parent_location(self, url):
2044
2001
        """Set the parent branch"""