~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Robert Collins
  • Date: 2005-10-18 06:42:17 UTC
  • mfrom: (0.2.1)
  • mto: This revision was merged to the branch mainline in revision 1463.
  • Revision ID: robertc@robertcollins.net-20051018064217-e810bd94c74a9ad1
Factor out the guts of 'pull' from the command into WorkingTree.pull().
(Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
348
348
            else:
349
349
                print "Using saved location: %s" % stored_loc
350
350
                location = stored_loc
351
 
        cache_root = tempfile.mkdtemp()
352
351
        br_from = Branch.open(location)
353
 
        br_from.lock_read()
354
352
        try:
355
 
            br_from.setup_caching(cache_root)
356
 
            location = br_from.base
357
 
            old_revno = br_to.revno()
358
 
            old_revision_history = br_to.revision_history()
359
 
            try:
360
 
                br_to.update_revisions(br_from)
361
 
            except DivergedBranches:
362
 
                raise BzrCommandError("These branches have diverged."
363
 
                    "  Try merge.")
364
 
            new_revision_history = br_to.revision_history()
365
 
            if new_revision_history != old_revision_history:
366
 
                merge(('.', -1), ('.', old_revno), check_clean=False)
367
 
            if stored_loc is None or remember:
368
 
                br_to.set_parent(location)
369
 
        finally:
370
 
            br_from.unlock()
371
 
            rmtree(cache_root)
372
 
 
 
353
            br_to.working_tree().pull(br_from, remember)
 
354
        except DivergedBranches:
 
355
            raise BzrCommandError("These branches have diverged."
 
356
                                  "  Try merge.")
373
357
 
374
358
 
375
359
class cmd_branch(Command):