~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

Merged John Meinel's integration

Show diffs side-by-side

added added

removed removed

Lines of Context:
392
392
    If you want to forget your local changes and just update your branch to
393
393
    match the remote one, use --overwrite.
394
394
    """
395
 
    takes_options = ['remember', 'overwrite', 'verbose']
 
395
    takes_options = ['remember', 'overwrite', 'revision', 'verbose']
396
396
    takes_args = ['location?']
397
397
 
398
 
    def run(self, location=None, remember=False, overwrite=False, verbose=False):
 
398
    def run(self, location=None, remember=False, overwrite=False, revision=None, verbose=False):
399
399
        from shutil import rmtree
400
400
        import errno
401
401
        # FIXME: too much stuff is in the command class        
411
411
        br_from = Branch.open(location)
412
412
        br_to = tree_to.branch
413
413
 
 
414
        if revision is None:
 
415
            rev_id = None
 
416
        elif len(revision) == 1:
 
417
            rev_id = revision[0].in_history(br_from).rev_id
 
418
        else:
 
419
            raise BzrCommandError('bzr pull --revision takes one value.')
 
420
 
414
421
        old_rh = br_to.revision_history()
415
 
        count = tree_to.pull(br_from, overwrite)
 
422
        count = tree_to.pull(br_from, overwrite, rev_id)
416
423
 
417
424
        if br_to.get_parent() is None or remember:
418
425
            br_to.set_parent(location)
942
949
            rev1 = rev2 = revision[0].in_history(b).revno
943
950
        elif len(revision) == 2:
944
951
            rev1 = revision[0].in_history(b).revno
945
 
            rev2 = revision[1].in_history(b).revno
 
952
            if revision[1].spec is None:
 
953
                # missing end-range means last known revision
 
954
                rev2 = b.revno()
 
955
            else:
 
956
                rev2 = revision[1].in_history(b).revno
946
957
        else:
947
958
            raise BzrCommandError('bzr log --revision takes one or two values.')
948
959
 
1556
1567
        last1 = branch1.last_revision()
1557
1568
        last2 = branch2.last_revision()
1558
1569
 
1559
 
        source = MultipleRevisionSources(branch1, branch2)
 
1570
        source = MultipleRevisionSources(branch1.repository, 
 
1571
                                         branch2.repository)
1560
1572
        
1561
1573
        base_rev_id = common_ancestor(last1, last2, source)
1562
1574