~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Olaf Conradi
  • Date: 2006-03-28 23:30:02 UTC
  • mto: (1661.1.1 bzr.mbp.remember)
  • mto: This revision was merged to the branch mainline in revision 1663.
  • Revision ID: olaf@conradi.org-20060328233002-f6262df0e19c1963
Added testcases for using pull with --remember. Moved remember code to
beginning of cmd_pull. This remembers the location in case of a failure
during pull.

Show diffs side-by-side

added added

removed removed

Lines of Context:
417
417
    def run(self, location=None, remember=False, overwrite=False, revision=None, verbose=False):
418
418
        # FIXME: too much stuff is in the command class        
419
419
        tree_to = WorkingTree.open_containing(u'.')[0]
 
420
        br_to = tree_to.branch
420
421
        stored_loc = tree_to.branch.get_parent()
421
422
        if location is None:
422
423
            if stored_loc is None:
425
426
                print "Using saved location: %s" % stored_loc
426
427
                location = stored_loc
427
428
 
 
429
        if br_to.get_parent() is None or remember:
 
430
            br_to.set_parent(location)
 
431
 
428
432
        br_from = Branch.open(location)
429
 
        br_to = tree_to.branch
430
433
 
431
434
        if revision is None:
432
435
            rev_id = None
437
440
 
438
441
        old_rh = br_to.revision_history()
439
442
        count = tree_to.pull(br_from, overwrite, rev_id)
440
 
 
441
 
        if br_to.get_parent() is None or remember:
442
 
            br_to.set_parent(location)
443
443
        note('%d revision(s) pulled.' % (count,))
444
444
 
445
445
        if verbose: