~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Martin Pool
  • Date: 2007-02-23 05:39:35 UTC
  • mto: (2220.2.35 tags)
  • mto: This revision was merged to the branch mainline in revision 2309.
  • Revision ID: mbp@sourcefrog.net-20070223053935-r601f8e1xwwljm21
Pull now returns a PullResult rather than just an integer.

Remove old Branch.is_control_file function.

Show diffs side-by-side

added added

removed removed

Lines of Context:
597
597
 
598
598
        old_rh = branch_to.revision_history()
599
599
        if tree_to is not None:
600
 
            count = tree_to.pull(branch_from, overwrite, rev_id,
 
600
            result = tree_to.pull(branch_from, overwrite, rev_id,
601
601
                delta.ChangeReporter(tree_to.inventory))
602
602
        else:
603
 
            count = branch_to.pull(branch_from, overwrite, rev_id)
604
 
        note('%d revision(s) pulled.' % (count,))
 
603
            result = branch_to.pull(branch_from, overwrite, rev_id)
605
604
 
606
 
        if verbose:
 
605
        if result.old_revid == result.new_revid:
 
606
            note('No revisions to pull.')
 
607
        elif verbose:
 
608
            from bzrlib.log import show_changed_revisions
607
609
            new_rh = branch_to.revision_history()
608
 
            if old_rh != new_rh:
609
 
                # Something changed
610
 
                from bzrlib.log import show_changed_revisions
611
 
                show_changed_revisions(branch_to, old_rh, new_rh,
612
 
                                       to_file=self.outf)
 
610
            show_changed_revisions(branch_to, old_rh, new_rh, to_file=self.outf)
 
611
        else:
 
612
            note('Now on revision %d.' % result.new_revno)
613
613
 
614
614
 
615
615
class cmd_push(Command):
3228
3228
            return 0
3229
3229
        if file_list is None:
3230
3230
            if pull and merger.base_rev_id == merger.this_rev_id:
3231
 
                count = merger.this_tree.pull(merger.this_branch,
 
3231
                # FIXME: deduplicate with pull
 
3232
                result = merger.this_tree.pull(merger.this_branch,
3232
3233
                        False, merger.other_rev_id)
3233
 
                note('%d revision(s) pulled.' % (count,))
 
3234
                if result.old_revid == result.new_revid:
 
3235
                    note('No revisions to pull.')
 
3236
                else:
 
3237
                    note('Now on revision %d.' % result.new_revno)
3234
3238
                return 0
3235
3239
        merger.backup_files = backup_files
3236
3240
        merger.merge_type = merge_type