~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/foreign.py

  • Committer: INADA Naoki
  • Date: 2011-05-05 09:15:34 UTC
  • mto: (5830.3.3 i18n-msgfmt)
  • mto: This revision was merged to the branch mainline in revision 5873.
  • Revision ID: songofacandy@gmail.com-20110505091534-7sv835xpofwrmpt4
Add update-pot command to Makefile and tools/bzrgettext script that
extracts help text from bzr commands.

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,
23
24
    )
24
25
from bzrlib.commands import Command, Option
25
26
from bzrlib.repository import Repository
314
315
        target_branch.lock_write()
315
316
        try:
316
317
            try:
317
 
                push_result = source_branch.push(target_branch, lossy=True)
 
318
                push_result = source_branch.lossy_push(target_branch)
318
319
            except errors.LossyPushToSameVCS:
319
320
                raise BzrCommandError("%r and %r are in the same VCS, lossy "
320
321
                    "push not necessary. Please use regular push." %
337
338
            push_result.report(self.outf)
338
339
        finally:
339
340
            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)