~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Robert Collins
  • Date: 2006-03-05 02:20:07 UTC
  • mto: This revision was merged to the branch mainline in revision 1590.
  • Revision ID: robertc@robertcollins.net-20060305022007-53e5907d083453e8
Local commits appear to be working properly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
597
597
                else:
598
598
                    raise
599
599
            try:
600
 
                dir = br_from.bzrdir.sprout(to_location, revision_id, basis_dir)
601
 
                branch = dir.open_branch()
 
600
                # bound branches require a version upgrade
 
601
                if bound and not isinstance(br_from.bzrdir._format,
 
602
                                            bzrdir.BzrDirMetaFormat1):
 
603
                    old_format = bzrlib.bzrdir.BzrDirFormat.get_default_format()
 
604
                    bzrlib.bzrdir.BzrDirFormat.set_default_format(
 
605
                        bzrdir.BzrDirMetaFormat1())
 
606
                    try:
 
607
                        branch = bzrlib.bzrdir.BzrDir.create_branch_convenience(
 
608
                            to_location)
 
609
                    finally:
 
610
                        bzrlib.bzrdir.BzrDirFormat.set_default_format(
 
611
                            old_format)
 
612
                else:
 
613
                    # preserve whatever source version we have.
 
614
                    dir = br_from.bzrdir.sprout(to_location, revision_id, basis_dir)
 
615
                    branch = dir.open_branch()
602
616
            except bzrlib.errors.NoSuchRevision:
603
617
                rmtree(to_location)
604
618
                msg = "The branch %s has no revision %s." % (from_location, revision[0])
701
715
        tree.lock_write()
702
716
        try:
703
717
            if tree.last_revision() == tree.branch.last_revision():
704
 
                note("Tree is up to date.")
705
 
                return
 
718
                # may be up to date, check master too.
 
719
                master = tree.branch.get_master_branch()
 
720
                if master and master.last_revision == tree.last_revision():
 
721
                    note("Tree is up to date.")
 
722
                    return
706
723
            conflicts = tree.update()
707
724
            note('Updated to revision %d.' %
708
725
                 (tree.branch.revision_id_to_revno(tree.last_revision()),))
1438
1455
            
1439
1456
        try:
1440
1457
            tree.commit(message, specific_files=selected_list,
1441
 
                        allow_pointless=unchanged, strict=strict)
 
1458
                        allow_pointless=unchanged, strict=strict, local=local)
1442
1459
        except PointlessCommit:
1443
1460
            # FIXME: This should really happen before the file is read in;
1444
1461
            # perhaps prepare the commit; get the message; then actually commit