mercurial/ui.py
changeset 27561 723413ee000e
parent 27500 62b1b6a89d2a
child 27563 56c2caffde3d
--- a/mercurial/ui.py	Thu Dec 24 19:32:14 2015 +0000
+++ b/mercurial/ui.py	Sat Dec 26 16:10:39 2015 +0900
@@ -1115,7 +1115,7 @@
             self['default'].pushloc = defaultpush
 
     def getpath(self, name, default=None):
-        """Return a ``path`` from a string, falling back to a default.
+        """Return a ``path`` from a string, falling back to default.
 
         ``name`` can be a named path or locations. Locations are filesystem
         paths or URIs.
@@ -1125,13 +1125,16 @@
         """
         # Only fall back to default if no path was requested.
         if name is None:
-            if default:
+            if not default:
+                default = ()
+            elif not isinstance(default, (tuple, list)):
+                default = (default,)
+            for k in default:
                 try:
-                    return self[default]
+                    return self[k]
                 except KeyError:
-                    return None
-            else:
-                return None
+                    continue
+            return None
 
         # Most likely empty string.
         # This may need to raise in the future.