~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Martin Pool
  • Date: 2006-03-09 07:14:10 UTC
  • mfrom: (1600 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1602.
  • Revision ID: mbp@sourcefrog.net-20060309071410-4ab7d54905541c75
[merge] from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
495
495
                print "Using saved location: %s" % stored_loc
496
496
                location = stored_loc
497
497
        try:
498
 
            br_to = Branch.open(location)
 
498
            dir_to = bzrlib.bzrdir.BzrDir.open(location)
 
499
            br_to = dir_to.open_branch()
499
500
        except NotBranchError:
500
501
            # create a branch.
501
502
            transport = get_transport(location).clone('..')
520
521
                        if new_transport.base == transport.base:
521
522
                            raise BzrCommandError("Could not creeate "
522
523
                                                  "path prefix.")
523
 
            br_to = bzrlib.bzrdir.BzrDir.create_branch_convenience(location)
 
524
            dir_to = br_from.bzrdir.clone(location)
 
525
            br_to = dir_to.open_branch()
524
526
        old_rh = br_to.revision_history()
525
527
        try:
526
528
            try:
527
 
                tree_to = br_to.working_tree()
528
 
            except NoWorkingTree:
 
529
                tree_to = dir_to.open_workingtree()
 
530
            except errors.NotLocalUrl:
529
531
                # TODO: This should be updated for branches which don't have a
530
532
                # working tree, as opposed to ones where we just couldn't 
531
533
                # update the tree.
532
534
                warning('Unable to update the working tree of: %s' % (br_to.base,))
533
535
                count = br_to.pull(br_from, overwrite)
 
536
            except NoWorkingTree:
 
537
                count = br_to.pull(br_from, overwrite)
534
538
            else:
535
539
                count = tree_to.pull(br_from, overwrite)
536
540
        except DivergedBranches:
1782
1786
    will be used as a BASE, and the second one as OTHER.  Revision
1783
1787
    numbers are always relative to the specified branch.
1784
1788
 
1785
 
    By default bzr will try to merge in all new work from the other
 
1789
    By default, bzr will try to merge in all new work from the other
1786
1790
    branch, automatically determining an appropriate base.  If this
1787
1791
    fails, you may need to give an explicit base.
1788
1792
    
 
1793
    Merge will do its best to combine the changes in two branches, but there
 
1794
    are some kinds of problems only a human can fix.  When it encounters those,
 
1795
    it will mark a conflict.  A conflict means that you need to fix something,
 
1796
    before you should commit.
 
1797
 
 
1798
    Use bzr resolve when you have fixed a problem.  See also bzr conflicts.
 
1799
 
1789
1800
    Examples:
1790
1801
 
1791
1802
    To merge the latest revision from bzr.dev
1833
1844
 
1834
1845
                base = [branch, revision[0].in_history(b).revno]
1835
1846
                other = [branch, revision[1].in_history(b).revno]
1836
 
 
 
1847
        pb = bzrlib.ui.ui_factory.nested_progress_bar()
1837
1848
        try:
1838
 
            conflict_count = merge(other, base, check_clean=(not force),
1839
 
                                   merge_type=merge_type, reprocess=reprocess,
1840
 
                                   show_base=show_base, 
1841
 
                                   pb=bzrlib.ui.ui_factory.progress_bar())
 
1849
            try:
 
1850
                conflict_count = merge(other, base, check_clean=(not force),
 
1851
                                       merge_type=merge_type, 
 
1852
                                       reprocess=reprocess,
 
1853
                                       show_base=show_base, 
 
1854
                                       pb=pb)
 
1855
            finally:
 
1856
                pb.finished()
1842
1857
            if conflict_count != 0:
1843
1858
                return 1
1844
1859
            else:
1942
1957
            raise BzrCommandError('bzr revert --revision takes exactly 1 argument')
1943
1958
        else:
1944
1959
            rev_id = revision[0].in_history(tree.branch).rev_id
1945
 
        tree.revert(file_list, tree.branch.repository.revision_tree(rev_id),
1946
 
                    not no_backup, bzrlib.ui.ui_factory.progress_bar())
 
1960
        pb = bzrlib.ui.ui_factory.nested_progress_bar()
 
1961
        try:
 
1962
            tree.revert(file_list, 
 
1963
                        tree.branch.repository.revision_tree(rev_id),
 
1964
                        not no_backup, pb)
 
1965
        finally:
 
1966
            pb.finished()
1947
1967
 
1948
1968
 
1949
1969
class cmd_assert_fail(Command):