1102
1102
stop_revision=stop_revision,
1103
1103
possible_transports=possible_transports, *args, **kwargs)
1105
def push(self, target, overwrite=False, stop_revision=None, *args,
1105
def push(self, target, overwrite=False, stop_revision=None, lossy=False,
1107
1107
"""Mirror this branch into target.
1109
1109
This branch is considered to be 'local', having low latency.
1111
1111
return InterBranch.get(self, target).push(overwrite, stop_revision,
1114
def lossy_push(self, target, stop_revision=None):
1115
"""Push deltas into another branch.
1117
:note: This does not, like push, retain the revision ids from
1118
the source branch and will, rather than adding bzr-specific
1119
metadata, push only those semantics of the revision that can be
1120
natively represented by this branch' VCS.
1122
:param target: Target branch
1123
:param stop_revision: Revision to push, defaults to last revision.
1124
:return: BranchPushResult with an extra member revidmap:
1125
A dictionary mapping revision ids from the target branch
1126
to new revision ids in the target branch, for each
1127
revision that was pushed.
1129
inter = InterBranch.get(self, target)
1130
lossy_push = getattr(inter, "lossy_push", None)
1131
if lossy_push is None:
1132
raise errors.LossyPushToSameVCS(self, target)
1133
return lossy_push(stop_revision)
1112
lossy, *args, **kwargs)
1135
1114
def basis_tree(self):
1136
1115
"""Return `Tree` object for last revision."""
3251
3230
raise NotImplementedError(self.pull)
3253
3232
@needs_write_lock
3254
def push(self, overwrite=False, stop_revision=None,
3233
def push(self, overwrite=False, stop_revision=None, lossy=False,
3255
3234
_override_hook_source_branch=None):
3256
3235
"""Mirror the source branch into the target branch.
3405
3384
if master_branch:
3406
3385
master_branch.unlock()
3408
def push(self, overwrite=False, stop_revision=None,
3387
def push(self, overwrite=False, stop_revision=None, lossy=False,
3409
3388
_override_hook_source_branch=None):
3410
3389
"""See InterBranch.push.
3416
3395
This is for use of RemoteBranch, where push is delegated to the
3417
3396
underlying vfs-based Branch.
3399
raise errors.LossyPushToSameVCS(self.source, self.target)
3419
3400
# TODO: Public option to disable running hooks - should be trivial but
3421
3402
self.source.lock_read()
3423
3404
return _run_with_write_locked_target(
3424
3405
self.target, self._push_with_bound_branches, overwrite,
3426
3407
_override_hook_source_branch=_override_hook_source_branch)
3428
3409
self.source.unlock()