~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

Make the test test_time_creates_benchmark_in_result more robust to timing variation.

Show diffs side-by-side

added added

removed removed

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