Commits

Kirk Kelsey committed 24c6baa

strip away sub-domains until a potential match is found

Comments (0)

Files changed (1)

         def_domain = m.group(1)
     identities = dict(ui.configitems("identities"))
     if identities:
-        if identities.has_key(def_domain):
-            kwargs["user"] = identities[def_domain]
-        else:
+        kwargs["user"] = None
+        while def_domain and kwargs["user"] is None:
+            if identities.has_key(def_domain):
+                kwargs["user"] = identities[def_domain]
+            elif def_domain.find(".") != -1:
+                def_domain = def_domain[def_domain.find(".")+1:]
+            else:
+                def_domain = None
+        if kwargs["user"] is None:
             identities = [(k, identities[k]) for k in identities.keys()]
             identities.insert(0, ("default", ui.username()))
             ui.write("Commit changeset as user:\n")