changeset 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
files mercurial/commands.py
diffstat 1 files changed, 7 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Wed Mar 10 10:51:37 2010 -0800
+++ b/mercurial/commands.py	Wed Mar 10 21:14:24 2010 +0100
@@ -2885,13 +2885,12 @@
     optlist = ("name templates style address port prefix ipv6"
                " accesslog errorlog webdir_conf certificate encoding")
     for o in optlist.split():
-        try: val = opts[o]
-        except KeyError: continue
-        else:
-            if val == '': continue
-            baseui.setconfig("web", o, val)
-            if repo and repo.ui != baseui:
-                repo.ui.setconfig("web", o, val)
+        val = opts.get(o, '')
+        if val is None or val == '': # should check against default options instead
+            continue
+        baseui.setconfig("web", o, val)
+        if repo and repo.ui != baseui:
+            repo.ui.setconfig("web", o, val)
 
     if repo is None and not ui.config("web", "webdir_conf"):
         raise error.RepoError(_("There is no Mercurial repository here"
@@ -2924,7 +2923,7 @@
             if ':' in fqaddr:
                 fqaddr = '[%s]' % fqaddr
             if opts['port']:
-                write = ui.status    
+                write = ui.status
             else:
                 write = ui.write
             write(_('listening at http://%s%s/%s (bound to %s:%d)\n') %