~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Martin Pool
  • Date: 2006-01-13 06:57:59 UTC
  • mto: (1185.65.28 storage)
  • mto: This revision was merged to the branch mainline in revision 1550.
  • Revision ID: mbp@sourcefrog.net-20060113065759-13605598ac561067
review fixups from John

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
# cache in memory to make this faster.  In general anything can be
64
64
# cached in memory between lock and unlock operations.
65
65
 
66
 
# FIXME: At the moment locking the Branch locks both the repository and the
67
 
# control files, representing the two aspects currently controlled by one
68
 
# object.  However, they currently both map to the same lockfile. 
69
 
 
70
66
def find_branch(*ignored, **ignored_too):
71
67
    # XXX: leave this here for about one release, then remove it
72
68
    raise NotImplementedError('find_branch() is not supported anymore, '
133
129
        """Subclasses that care about caching should override this, and set
134
130
        up cached stores located under cache_root.
135
131
        """
 
132
        # seems to be unused, 2006-01-13 mbp
 
133
        warn('%s is deprecated' % self.setup_caching)
136
134
        self.cache_root = cache_root
137
135
 
138
136
    def _get_nick(self):
161
159
 
162
160
    def peek_lock_mode(self):
163
161
        """Return lock mode for the Branch: 'r', 'w' or None"""
164
 
        raise NotImplementedError(self.is_locked)
 
162
        raise NotImplementedError(self.peek_lock_mode)
165
163
 
166
164
    def abspath(self, name):
167
165
        """Return absolute filename for something in the branch
378
376
        to_branch_type
379
377
            Branch type of destination branch
380
378
        """
 
379
        # circular import protection
 
380
        from bzrlib.merge import build_working_dir
 
381
 
381
382
        assert isinstance(to_location, basestring)
382
383
        if not bzrlib.osutils.lexists(to_location):
383
384
            os.mkdir(to_location)
392
393
            revision = self.last_revision()
393
394
        br_to.update_revisions(self, stop_revision=revision)
394
395
        br_to.set_parent(self.base)
395
 
        # circular import protection
396
 
        from bzrlib.merge import build_working_dir
397
396
        build_working_dir(to_location)
398
397
        mutter("copied")
399
398
        return br_to
479
478
        # Alternatively, we could have the Transport objects cache requests
480
479
        # See the earlier discussion about how major objects (like Branch)
481
480
        # should never expect their __del__ function to run.
 
481
        # XXX: cache_root seems to be unused, 2006-01-13 mbp
482
482
        if hasattr(self, 'cache_root') and self.cache_root is not None:
483
483
            try:
484
484
                shutil.rmtree(self.cache_root)