~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/foreign.py

  • Committer: Vincent Ladeuil
  • Date: 2011-06-27 15:42:09 UTC
  • mfrom: (5993 +trunk)
  • mto: (5993.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 5994.
  • Revision ID: v.ladeuil+lp@free.fr-20110627154209-azubuhbuxsz109hq
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
    registry,
32
32
    transform,
33
33
    )
34
 
from bzrlib.i18n import gettext
35
34
""")
36
35
 
37
36
class VcsMapping(object):
283
282
    def run(self, location=None, remember=False, directory=None,
284
283
            no_rebase=False, strict=None):
285
284
        from bzrlib import urlutils
286
 
        from bzrlib.controldir import ControlDir
 
285
        from bzrlib.bzrdir import BzrDir
287
286
        from bzrlib.errors import BzrCommandError, NoWorkingTree
288
287
        from bzrlib.workingtree import WorkingTree
289
288
 
303
302
        stored_loc = source_branch.get_push_location()
304
303
        if location is None:
305
304
            if stored_loc is None:
306
 
                raise BzrCommandError(gettext("No push location known or specified."))
 
305
                raise BzrCommandError("No push location known or specified.")
307
306
            else:
308
307
                display_url = urlutils.unescape_for_display(stored_loc,
309
308
                        self.outf.encoding)
310
 
                self.outf.write(
311
 
                       gettext("Using saved location: %s\n") % display_url)
 
309
                self.outf.write("Using saved location: %s\n" % display_url)
312
310
                location = stored_loc
313
311
 
314
 
        controldir = ControlDir.open(location)
315
 
        target_branch = controldir.open_branch()
 
312
        bzrdir = BzrDir.open(location)
 
313
        target_branch = bzrdir.open_branch()
316
314
        target_branch.lock_write()
317
315
        try:
318
316
            try:
319
317
                push_result = source_branch.push(target_branch, lossy=True)
320
318
            except errors.LossyPushToSameVCS:
321
 
                raise BzrCommandError(gettext("{0!r} and {1!r} are in the same VCS, lossy "
322
 
                    "push not necessary. Please use regular push.").format(
323
 
                    source_branch, target_branch))
 
319
                raise BzrCommandError("%r and %r are in the same VCS, lossy "
 
320
                    "push not necessary. Please use regular push." %
 
321
                    (source_branch, target_branch))
324
322
            # We successfully created the target, remember it
325
323
            if source_branch.get_push_location() is None or remember:
326
324
                source_branch.set_push_location(target_branch.base)