~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/remote.py

  • Committer: John Arbash Meinel
  • Date: 2007-05-08 20:00:50 UTC
  • mfrom: (2477.1.13 0.16-release)
  • mto: This revision was merged to the branch mainline in revision 2484.
  • Revision ID: john@arbash-meinel.com-20070508200050-4imwmtzep8fx5v7w
Merge the 0.16 release fixes back into bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
from cStringIO import StringIO
21
21
 
22
22
from bzrlib import branch, errors, lockdir, repository
23
 
from bzrlib.branch import BranchReferenceFormat
 
23
from bzrlib.branch import Branch, BranchReferenceFormat
24
24
from bzrlib.bzrdir import BzrDir, RemoteBzrDirFormat
25
25
from bzrlib.config import BranchConfig, TreeConfig
26
26
from bzrlib.decorators import needs_read_lock, needs_write_lock
764
764
        self._lock_count = 0
765
765
        self._leave_lock = False
766
766
 
 
767
    def __str__(self):
 
768
        return "%s(%s)" % (self.__class__.__name__, self.base)
 
769
 
 
770
    __repr__ = __str__
 
771
 
767
772
    def _ensure_real(self):
768
773
        """Ensure that there is a _real_branch set.
769
774
 
991
996
        return self._real_branch.append_revision(*revision_ids)
992
997
 
993
998
    @needs_write_lock
994
 
    def pull(self, source, overwrite=False, stop_revision=None):
 
999
    def pull(self, source, overwrite=False, stop_revision=None,
 
1000
             **kwargs):
 
1001
        # FIXME: This asks the real branch to run the hooks, which means
 
1002
        # they're called with the wrong target branch parameter. 
 
1003
        # The test suite specifically allows this at present but it should be
 
1004
        # fixed.  It should get a _override_hook_target branch,
 
1005
        # as push does.  -- mbp 20070405
995
1006
        self._ensure_real()
996
1007
        self._real_branch.pull(
997
 
            source, overwrite=overwrite, stop_revision=stop_revision)
 
1008
            source, overwrite=overwrite, stop_revision=stop_revision,
 
1009
            **kwargs)
998
1010
 
999
1011
    @needs_read_lock
1000
1012
    def push(self, target, overwrite=False, stop_revision=None):
1001
1013
        self._ensure_real()
1002
1014
        return self._real_branch.push(
1003
 
            target, overwrite=overwrite, stop_revision=stop_revision)
 
1015
            target, overwrite=overwrite, stop_revision=stop_revision,
 
1016
            _override_hook_source_branch=self)
1004
1017
 
1005
1018
    def is_locked(self):
1006
1019
        return self._lock_count >= 1