/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: Martin Albisetti
  • Date: 2009-11-28 02:42:32 UTC
  • mto: (0.152.67 trunk)
  • mto: This revision was merged to the branch mainline in revision 6649.
  • Revision ID: martin.albisetti@canonical.com-20091128024232-j8lbwd2rscsdcq5y
Clean up whitespace to appease the neurotic in me

Show diffs side-by-side

added added

removed removed

Lines of Context:
407
407
        # If we can't find the revid file on the remote location, upload the
408
408
        # full tree instead
409
409
        rev_id = self.get_uploaded_revid()
410
 
        
 
410
 
411
411
        if rev_id == revision.NULL_REVISION:
412
412
            if not self.quiet:
413
413
                self.outf.write('No uploaded revision id found,'
528
528
 
529
529
        (wt, branch,
530
530
         relpath) = bzrdir.BzrDir.open_containing_tree_or_branch(directory)
531
 
        
 
531
 
532
532
        if wt:
533
533
            wt.lock_read()
534
534
        else:
536
536
        try:
537
537
            if wt:
538
538
                changes = wt.changes_from(wt.basis_tree())
539
 
    
 
539
 
540
540
                if revision is None and  changes.has_changed():
541
541
                    raise errors.UncommittedChanges(wt)
542
 
    
 
542
 
543
543
            if location is None:
544
544
                stored_loc = get_upload_location(branch)
545
545
                if stored_loc is None:
551
551
                            self.outf.encoding)
552
552
                    self.outf.write("Using saved location: %s\n" % display_url)
553
553
                    location = stored_loc
554
 
    
 
554
 
555
555
            to_transport = transport.get_transport(location)
556
 
    
 
556
 
557
557
            # Check that we are not uploading to a existing working tree.
558
558
            try:
559
559
                to_bzr_dir = bzrdir.BzrDir.open_from_transport(to_transport)
563
563
            except errors.NotLocalUrl:
564
564
                # The exception raised is a bit weird... but that's life.
565
565
                has_wt = True
566
 
    
 
566
 
567
567
            if has_wt:
568
568
                raise CannotUploadToWorkingTreeError(url=location)
569
 
    
 
569
 
570
570
            if revision is None:
571
571
                rev_id = branch.last_revision()
572
572
            else:
574
574
                    raise errors.BzrCommandError(
575
575
                        'bzr upload --revision takes exactly 1 argument')
576
576
                rev_id = revision[0].in_history(branch).rev_id
577
 
    
 
577
 
578
578
            tree = branch.repository.revision_tree(rev_id)
579
 
    
 
579
 
580
580
            uploader = BzrUploader(branch, to_transport, self.outf, tree,
581
581
                                   rev_id, quiet=quiet)
582
 
            
 
582
 
583
583
            if not overwrite:
584
584
                prev_uploaded_rev_id = uploader.get_uploaded_revid()
585
585
                graph = branch.repository.get_graph()
586
586
                if not graph.is_ancestor(prev_uploaded_rev_id, rev_id):
587
587
                    raise DivergedError(rev_id, prev_uploaded_rev_id)
588
 
    
 
588
 
589
589
            if full:
590
590
                uploader.upload_full_tree()
591
591
            else:
622
622
 
623
623
    _fmt = ("The revision upload to this location is from a branch that is "
624
624
            "diverged from this branch: %(upload_revid)s")
625
 
    
 
625
 
626
626
    # We should probably tell the user to use merge on the diverged branch,
627
627
    # but how do we explan which branch they need to merge from!
628
628