wireproto: fix decodelist to properly return empty list
authorPeter Arrenbrecht <peter.arrenbrecht@gmail.com>
Tue, 22 Mar 2011 07:40:02 +0100
changeset 13722 f4a85acef50c
parent 13721 3458c15ab2f0
child 13723 e615765fdcc7
wireproto: fix decodelist to properly return empty list Needed by tests for next patch introducing known().
mercurial/wireproto.py
--- a/mercurial/wireproto.py	Tue Mar 22 07:38:32 2011 +0100
+++ b/mercurial/wireproto.py	Tue Mar 22 07:40:02 2011 +0100
@@ -15,7 +15,9 @@
 # list of nodes encoding / decoding
 
 def decodelist(l, sep=' '):
-    return map(bin, l.split(sep))
+    if l:
+        return map(bin, l.split(sep))
+    return []
 
 def encodelist(l, sep=' '):
     return sep.join(map(hex, l))