~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: John Arbash Meinel
  • Date: 2005-07-18 18:34:56 UTC
  • mto: (1185.11.1)
  • mto: This revision was merged to the branch mainline in revision 1396.
  • Revision ID: john@arbash-meinel.com-20050718183456-bab41f3d0a672c4f
Now that TransportError is being thrown, we have to change what gets caught higher up.

Show diffs side-by-side

added added

removed removed

Lines of Context:
526
526
 
527
527
    def run(self, location=None, revision=None):
528
528
        from bzrlib.merge import merge
 
529
        from bzrlib.transport import TransportError
529
530
        import errno
530
531
        
531
532
        br_to = find_branch('.')
532
533
        stored_loc = None
533
534
        try:
534
535
            stored_loc = br_to.controlfile("x-pull", "rb").read().rstrip('\n')
 
536
        except TransportError, e:
 
537
            pass
535
538
        except IOError, e:
536
539
            if e.errno != errno.ENOENT:
537
540
                raise
1810
1813
            finally:
1811
1814
                # do this here inside the exception wrappers to catch EPIPE
1812
1815
                sys.stdout.flush()
1813
 
        except BzrError, e:
1814
 
            quiet = isinstance(e, (BzrCommandError))
1815
 
            _report_exception('error: ' + e.args[0], quiet=quiet)
1816
 
            if len(e.args) > 1:
1817
 
                for h in e.args[1]:
1818
 
                    # some explanation or hints
1819
 
                    log_error('  ' + h)
1820
 
            return 1
1821
 
        except AssertionError, e:
1822
 
            msg = 'assertion failed'
1823
 
            if str(e):
1824
 
                msg += ': ' + str(e)
1825
 
            _report_exception(msg)
1826
 
            return 2
1827
 
        except KeyboardInterrupt, e:
1828
 
            _report_exception('interrupted', quiet=True)
1829
 
            return 2
 
1816
        #except BzrError, e:
 
1817
        #    quiet = isinstance(e, (BzrCommandError))
 
1818
        #    _report_exception('error: ' + e.args[0], quiet=quiet)
 
1819
        #    if len(e.args) > 1:
 
1820
        #        for h in e.args[1]:
 
1821
        #            # some explanation or hints
 
1822
        #            log_error('  ' + h)
 
1823
        #    return 1
 
1824
        #except AssertionError, e:
 
1825
        #    msg = 'assertion failed'
 
1826
        #    if str(e):
 
1827
        #        msg += ': ' + str(e)
 
1828
        #    _report_exception(msg)
 
1829
        #    return 2
 
1830
        #except KeyboardInterrupt, e:
 
1831
        #    _report_exception('interrupted', quiet=True)
 
1832
        #    return 2
1830
1833
        except Exception, e:
 
1834
            raise
1831
1835
            import errno
1832
1836
            quiet = False
1833
1837
            if (isinstance(e, IOError)