serve: fix options recording, trailing whitespace
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Wed, 10 Mar 2010 21:14:24 +0100
changeset 10630 9947e6b008bb
parent 10629 d3f27d15c9cb
child 10631 5247260cee6a
serve: fix options recording, trailing whitespace
mercurial/commands.py
--- 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') %