~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Martin Pool
  • Date: 2005-06-11 01:36:09 UTC
  • Revision ID: mbp@sourcefrog.net-20050611013609-4e1d44dc8e48ee79
- Don't create an empty destination directory when 
  branch fails to open the source.
  Fix from aaron.

Show diffs side-by-side

added added

removed removed

Lines of Context:
526
526
    def run(self, from_location, to_location=None):
527
527
        import errno
528
528
        from bzrlib.merge import merge
529
 
        
 
529
        from branch import find_branch, DivergedBranches
 
530
        try:
 
531
            br_from = find_branch(from_location)
 
532
        except OSError, e:
 
533
            if e.errno == errno.ENOENT:
 
534
                raise BzrCommandError('Source location "%s" does not exist.' %
 
535
                                      to_location)
 
536
            else:
 
537
                raise
 
538
 
530
539
        if to_location is None:
531
540
            to_location = os.path.basename(from_location)
532
541
            # FIXME: If there's a trailing slash, keep removing them
544
553
            else:
545
554
                raise
546
555
        br_to = Branch(to_location, init=True)
547
 
        from branch import find_branch, DivergedBranches
548
 
        try:
549
 
            br_from = find_branch(from_location)
550
 
        except OSError, e:
551
 
            if e.errno == errno.ENOENT:
552
 
                raise BzrCommandError('Source location "%s" does not exist.' %
553
 
                                      to_location)
554
 
            else:
555
 
                raise
556
556
 
557
557
        from_location = pull_loc(br_from)
558
558
        br_to.update_revisions(br_from)