~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

Merge sftp-leaks into catch-them-all

Show diffs side-by-side

added added

removed removed

Lines of Context:
246
246
        if not local and not config.has_explicit_nickname():
247
247
            try:
248
248
                master = self.get_master_branch(possible_transports)
 
249
                if master and self.user_url == master.user_url:
 
250
                    raise errors.RecursiveBind(self.user_url)
249
251
                if master is not None:
250
252
                    # return the master branch value
251
253
                    return master.nick
 
254
            except errors.RecursiveBind, e:
 
255
                raise e
252
256
            except errors.BzrError, e:
253
257
                # Silently fall back to local implicit nick if the master is
254
258
                # unavailable
1857
1861
            "all are called with the url returned from the previous hook."
1858
1862
            "The order is however undefined.", (1, 9), None))
1859
1863
        self.create_hook(HookPoint('automatic_tag_name',
1860
 
            "Called to determine an automatic tag name for a revision."
 
1864
            "Called to determine an automatic tag name for a revision. "
1861
1865
            "automatic_tag_name is called with (branch, revision_id) and "
1862
1866
            "should return a tag name or None if no tag name could be "
1863
1867
            "determined. The first non-None tag name returned will be used.",
1954
1958
        return self.__dict__ == other.__dict__
1955
1959
 
1956
1960
    def __repr__(self):
1957
 
        if self.branch:
1958
 
            return "<%s of %s>" % (self.__class__.__name__, self.branch)
1959
 
        else:
1960
 
            return "<%s of format:%s bzrdir:%s>" % (
1961
 
                self.__class__.__name__, self.branch,
1962
 
                self.format, self.bzrdir)
 
1961
        return "<%s of %s>" % (self.__class__.__name__, self.branch)
1963
1962
 
1964
1963
 
1965
1964
class SwitchHookParams(object):
3309
3308
        """
3310
3309
        raise NotImplementedError(self.push)
3311
3310
 
 
3311
    @needs_write_lock
 
3312
    def copy_content_into(self, revision_id=None):
 
3313
        """Copy the content of source into target
 
3314
 
 
3315
        revision_id: if not None, the revision history in the new branch will
 
3316
                     be truncated to end with revision_id.
 
3317
        """
 
3318
        raise NotImplementedError(self.copy_content_into)
 
3319
 
3312
3320
 
3313
3321
class GenericInterBranch(InterBranch):
3314
3322
    """InterBranch implementation that uses public Branch functions."""