~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/foreign.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-05-17 12:44:55 UTC
  • mfrom: (5853.2.8 lossy-argument)
  • Revision ID: pqm@pqm.ubuntu.com-20110517124455-8mzoceddh4wjmtgp
(jelmer) Make lossy an argument to Branch.pull. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
from bzrlib.branch import (
22
22
    Branch,
23
 
    InterBranch,
24
23
    )
25
24
from bzrlib.commands import Command, Option
26
25
from bzrlib.repository import Repository
315
314
        target_branch.lock_write()
316
315
        try:
317
316
            try:
318
 
                push_result = source_branch.lossy_push(target_branch)
 
317
                push_result = source_branch.push(target_branch, lossy=True)
319
318
            except errors.LossyPushToSameVCS:
320
319
                raise BzrCommandError("%r and %r are in the same VCS, lossy "
321
320
                    "push not necessary. Please use regular push." %
338
337
            push_result.report(self.outf)
339
338
        finally:
340
339
            target_branch.unlock()
341
 
 
342
 
 
343
 
class InterToForeignBranch(InterBranch):
344
 
 
345
 
    def lossy_push(self, stop_revision=None):
346
 
        """Push deltas into another branch.
347
 
 
348
 
        :note: This does not, like push, retain the revision ids from 
349
 
            the source branch and will, rather than adding bzr-specific 
350
 
            metadata, push only those semantics of the revision that can be 
351
 
            natively represented by this branch' VCS.
352
 
 
353
 
        :param target: Target branch
354
 
        :param stop_revision: Revision to push, defaults to last revision.
355
 
        :return: BranchPushResult with an extra member revidmap: 
356
 
            A dictionary mapping revision ids from the target branch 
357
 
            to new revision ids in the target branch, for each 
358
 
            revision that was pushed.
359
 
        """
360
 
        raise NotImplementedError(self.lossy_push)