~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Robert Collins
  • Date: 2006-03-07 20:34:47 UTC
  • mto: (1594.2.4 integration)
  • mto: This revision was merged to the branch mainline in revision 1596.
  • Revision ID: robertc@robertcollins.net-20060307203447-b7432f11cbd54c29
make push preserve tree formats.

Show diffs side-by-side

added added

removed removed

Lines of Context:
482
482
                print "Using saved location: %s" % stored_loc
483
483
                location = stored_loc
484
484
        try:
485
 
            br_to = Branch.open(location)
 
485
            dir_to = bzrlib.bzrdir.BzrDir.open(location)
 
486
            br_to = dir_to.open_branch()
486
487
        except NotBranchError:
487
488
            # create a branch.
488
489
            transport = get_transport(location).clone('..')
507
508
                        if new_transport.base == transport.base:
508
509
                            raise BzrCommandError("Could not creeate "
509
510
                                                  "path prefix.")
510
 
            br_to = bzrlib.bzrdir.BzrDir.create_branch_convenience(location)
 
511
            dir_to = br_from.bzrdir.clone(location)
 
512
            br_to = dir_to.open_branch()
511
513
        old_rh = br_to.revision_history()
512
514
        try:
513
515
            try:
514
 
                tree_to = br_to.working_tree()
515
 
            except NoWorkingTree:
 
516
                tree_to = dir_to.open_workingtree()
 
517
            except errors.NotLocalUrl:
516
518
                # TODO: This should be updated for branches which don't have a
517
519
                # working tree, as opposed to ones where we just couldn't 
518
520
                # update the tree.
519
521
                warning('Unable to update the working tree of: %s' % (br_to.base,))
520
522
                count = br_to.pull(br_from, overwrite)
 
523
            except NoWorkingTree:
 
524
                count = br_to.pull(br_from, overwrite)
521
525
            else:
522
526
                count = tree_to.pull(br_from, overwrite)
523
527
        except DivergedBranches: