~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Robert Collins
  • Date: 2006-05-15 05:06:57 UTC
  • mto: (1713.1.4 integration)
  • mto: This revision was merged to the branch mainline in revision 1714.
  • Revision ID: robertc@robertcollins.net-20060515050657-7232e2d1f6895fae
Show the correct number of revisions pushed when pushing a new branch (Robert Collins).

Show diffs side-by-side

added added

removed removed

Lines of Context:
518
518
                                                  "path prefix.")
519
519
            dir_to = br_from.bzrdir.clone(location)
520
520
            br_to = dir_to.open_branch()
521
 
        old_rh = br_to.revision_history()
522
 
        try:
 
521
            count = len(br_to.revision_history())
 
522
        else:
 
523
            old_rh = br_to.revision_history()
523
524
            try:
524
 
                tree_to = dir_to.open_workingtree()
525
 
            except errors.NotLocalUrl:
526
 
                # TODO: This should be updated for branches which don't have a
527
 
                # working tree, as opposed to ones where we just couldn't 
528
 
                # update the tree.
529
 
                warning('This transport does not update the working '
530
 
                        'tree of: %s' % (br_to.base,))
531
 
                count = br_to.pull(br_from, overwrite)
532
 
            except NoWorkingTree:
533
 
                count = br_to.pull(br_from, overwrite)
534
 
            else:
535
 
                count = tree_to.pull(br_from, overwrite)
536
 
        except DivergedBranches:
537
 
            raise BzrCommandError("These branches have diverged."
538
 
                                  "  Try a merge then push with overwrite.")
 
525
                try:
 
526
                    tree_to = dir_to.open_workingtree()
 
527
                except errors.NotLocalUrl:
 
528
                    warning('This transport does not update the working '
 
529
                            'tree of: %s' % (br_to.base,))
 
530
                    count = br_to.pull(br_from, overwrite)
 
531
                except NoWorkingTree:
 
532
                    count = br_to.pull(br_from, overwrite)
 
533
                else:
 
534
                    count = tree_to.pull(br_from, overwrite)
 
535
            except DivergedBranches:
 
536
                raise BzrCommandError("These branches have diverged."
 
537
                                      "  Try a merge then push with overwrite.")
539
538
        note('%d revision(s) pushed.' % (count,))
540
539
 
541
540
        if verbose: