~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

(jameinel) Allow 'bzr serve' to interpret SIGHUP as a graceful shutdown.
 (bug #795025) (John A Meinel)

Show diffs side-by-side

added added

removed removed

Lines of Context:
5255
5255
                    'option leads to global uncontrolled write access to your '
5256
5256
                    'file system.'
5257
5257
                ),
 
5258
        Option('client-timeout', type=float,
 
5259
               help='Override the default idle client timeout (5min).'),
5258
5260
        ]
5259
5261
 
5260
5262
    def get_host_and_port(self, port):
5277
5279
        return host, port
5278
5280
 
5279
5281
    def run(self, port=None, inet=False, directory=None, allow_writes=False,
5280
 
            protocol=None):
 
5282
            protocol=None, client_timeout=None):
5281
5283
        from bzrlib import transport
5282
5284
        if directory is None:
5283
5285
            directory = os.getcwd()
5288
5290
        if not allow_writes:
5289
5291
            url = 'readonly+' + url
5290
5292
        t = transport.get_transport(url)
5291
 
        protocol(t, host, port, inet)
 
5293
        try:
 
5294
            protocol(t, host, port, inet, client_timeout)
 
5295
        except TypeError, e:
 
5296
            # We use symbol_versioning.deprecated_in just so that people
 
5297
            # grepping can find it here.
 
5298
            # symbol_versioning.deprecated_in((2, 5, 0))
 
5299
            symbol_versioning.warn(
 
5300
                'Got TypeError(%s)\ntrying to call protocol: %s.%s\n'
 
5301
                'Most likely it needs to be updated to support a'
 
5302
                ' "timeout" parameter (added in bzr 2.5.0)'
 
5303
                % (e, protocol.__module__, protocol),
 
5304
                DeprecationWarning)
 
5305
            protocol(t, host, port, inet)
5292
5306
 
5293
5307
 
5294
5308
class cmd_join(Command):