~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: John Arbash Meinel
  • Date: 2005-07-11 22:48:09 UTC
  • mto: (1185.11.1)
  • mto: This revision was merged to the branch mainline in revision 1396.
  • Revision ID: john@arbash-meinel.com-20050711224808-97379668b1ac5379
bzr pull takes --revision

Show diffs side-by-side

added added

removed removed

Lines of Context:
522
522
    from one into the other.
523
523
    """
524
524
    takes_args = ['location?']
 
525
    takes_options = ['revision']
525
526
 
526
 
    def run(self, location=None):
 
527
    def run(self, location=None, revision=None):
527
528
        from bzrlib.merge import merge
528
529
        import errno
529
530
        
541
542
                print "Using last location: %s" % stored_loc
542
543
                location = stored_loc
543
544
 
 
545
        if revision is None:
 
546
            revision = [None]
 
547
        else:
 
548
            if len(revision) > 1:
 
549
                raise BzrCommandError('bzr pull --revision takes exactly 1 revision value')
 
550
 
544
551
        from bzrlib.branch import DivergedBranches
545
552
        br_from = find_branch(location)
546
553
        location = br_from.base
547
554
        old_revno = br_to.revno()
548
555
        try:
 
556
            revno, rev_id = br_from.get_revision_info(revision[0])
549
557
            try:
550
 
                br_to.update_revisions(br_from)
 
558
                br_to.update_revisions(br_from, stop_revision=revno)
551
559
            except DivergedBranches:
552
560
                raise BzrCommandError("These branches have diverged."
553
561
                    "  Try merge.")