1098
1098
stop_revision=stop_revision,
1099
1099
possible_transports=possible_transports, *args, **kwargs)
1101
def push(self, target, overwrite=False, stop_revision=None, *args,
1101
def push(self, target, overwrite=False, stop_revision=None, lossy=False,
1103
1103
"""Mirror this branch into target.
1105
1105
This branch is considered to be 'local', having low latency.
1107
1107
return InterBranch.get(self, target).push(overwrite, stop_revision,
1110
def lossy_push(self, target, stop_revision=None):
1111
"""Push deltas into another branch.
1113
:note: This does not, like push, retain the revision ids from
1114
the source branch and will, rather than adding bzr-specific
1115
metadata, push only those semantics of the revision that can be
1116
natively represented by this branch' VCS.
1118
:param target: Target branch
1119
:param stop_revision: Revision to push, defaults to last revision.
1120
:return: BranchPushResult with an extra member revidmap:
1121
A dictionary mapping revision ids from the target branch
1122
to new revision ids in the target branch, for each
1123
revision that was pushed.
1125
inter = InterBranch.get(self, target)
1126
lossy_push = getattr(inter, "lossy_push", None)
1127
if lossy_push is None:
1128
raise errors.LossyPushToSameVCS(self, target)
1129
return lossy_push(stop_revision)
1108
lossy, *args, **kwargs)
1131
1110
def basis_tree(self):
1132
1111
"""Return `Tree` object for last revision."""
3243
3222
raise NotImplementedError(self.pull)
3245
3224
@needs_write_lock
3246
def push(self, overwrite=False, stop_revision=None,
3225
def push(self, overwrite=False, stop_revision=None, lossy=False,
3247
3226
_override_hook_source_branch=None):
3248
3227
"""Mirror the source branch into the target branch.
3397
3376
if master_branch:
3398
3377
master_branch.unlock()
3400
def push(self, overwrite=False, stop_revision=None,
3379
def push(self, overwrite=False, stop_revision=None, lossy=False,
3401
3380
_override_hook_source_branch=None):
3402
3381
"""See InterBranch.push.
3408
3387
This is for use of RemoteBranch, where push is delegated to the
3409
3388
underlying vfs-based Branch.
3391
raise errors.LossyPushToSameVCS(self.source, self.target)
3411
3392
# TODO: Public option to disable running hooks - should be trivial but
3413
3394
self.source.lock_read()
3415
3396
return _run_with_write_locked_target(
3416
3397
self.target, self._push_with_bound_branches, overwrite,
3398
stop_revision, lossy,
3418
3399
_override_hook_source_branch=_override_hook_source_branch)
3420
3401
self.source.unlock()