~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: John Arbash Meinel
  • Date: 2005-11-12 19:55:34 UTC
  • mto: (1587.1.6 bound-branches)
  • mto: This revision was merged to the branch mainline in revision 1590.
  • Revision ID: john@arbash-meinel.com-20051112195534-3e33d6225502834b
(broken) working on implementing bound branches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1096
1096
        self.revision_store.add(StringIO(gpg_strategy.sign(plaintext)), 
1097
1097
                                revision_id, "sig")
1098
1098
 
 
1099
    # Do we want a read lock?
 
1100
    def is_bound(self):
 
1101
        bound_path = self._rel_controlfilename('bound')
 
1102
        return self._transport.has(bound_path)
 
1103
 
 
1104
    @needs_write_lock
 
1105
    def bind(self, branch):
 
1106
        """Bind the local branch the othre branch"""
 
1107
        other = Branch.open(location)
 
1108
        if other.is_bound():
 
1109
            raise errors.CannotBind(msg='branch %s is bound' % (branch.base))
 
1110
        rh = self.revision_history()
 
1111
        other_rh = branch.revision_history()
 
1112
        self.put_controlfile('bound', StringIO(branch.base+'\n'))
 
1113
 
1099
1114
 
1100
1115
class ScratchBranch(_Branch):
1101
1116
    """Special test class: a branch that cleans up after itself.