comparison mercurial/commands.py @ 10630:9947e6b008bb

serve: fix options recording, trailing whitespace
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Wed, 10 Mar 2010 21:14:24 +0100
parents d3f27d15c9cb
children 5247260cee6a
comparison
equal deleted inserted replaced
10629:d3f27d15c9cb 10630:9947e6b008bb
2883 2883
2884 baseui = repo and repo.baseui or ui 2884 baseui = repo and repo.baseui or ui
2885 optlist = ("name templates style address port prefix ipv6" 2885 optlist = ("name templates style address port prefix ipv6"
2886 " accesslog errorlog webdir_conf certificate encoding") 2886 " accesslog errorlog webdir_conf certificate encoding")
2887 for o in optlist.split(): 2887 for o in optlist.split():
2888 try: val = opts[o] 2888 val = opts.get(o, '')
2889 except KeyError: continue 2889 if val is None or val == '': # should check against default options instead
2890 else: 2890 continue
2891 if val == '': continue 2891 baseui.setconfig("web", o, val)
2892 baseui.setconfig("web", o, val) 2892 if repo and repo.ui != baseui:
2893 if repo and repo.ui != baseui: 2893 repo.ui.setconfig("web", o, val)
2894 repo.ui.setconfig("web", o, val)
2895 2894
2896 if repo is None and not ui.config("web", "webdir_conf"): 2895 if repo is None and not ui.config("web", "webdir_conf"):
2897 raise error.RepoError(_("There is no Mercurial repository here" 2896 raise error.RepoError(_("There is no Mercurial repository here"
2898 " (.hg not found)")) 2897 " (.hg not found)"))
2899 2898
2922 2921
2923 fqaddr = self.httpd.fqaddr 2922 fqaddr = self.httpd.fqaddr
2924 if ':' in fqaddr: 2923 if ':' in fqaddr:
2925 fqaddr = '[%s]' % fqaddr 2924 fqaddr = '[%s]' % fqaddr
2926 if opts['port']: 2925 if opts['port']:
2927 write = ui.status 2926 write = ui.status
2928 else: 2927 else:
2929 write = ui.write 2928 write = ui.write
2930 write(_('listening at http://%s%s/%s (bound to %s:%d)\n') % 2929 write(_('listening at http://%s%s/%s (bound to %s:%d)\n') %
2931 (fqaddr, port, prefix, bindaddr, self.httpd.port)) 2930 (fqaddr, port, prefix, bindaddr, self.httpd.port))
2932 2931