notify: turned a set-like dict into a real set
authorMartin Geisler <mg@lazybytes.net>
Fri, 24 Apr 2009 17:32:18 +0200
changeset 8154 06f1e4e309ed
parent 8153 616f20e1004a
child 8155 b7cdfa2527be
notify: turned a set-like dict into a real set
hgext/notify.py
--- a/hgext/notify.py	Wed Apr 22 20:51:20 2009 +0200
+++ b/hgext/notify.py	Fri Apr 24 17:32:18 2009 +0200
@@ -146,18 +146,17 @@
 
     def subscribers(self):
         '''return list of email addresses of subscribers to this repo.'''
-        subs = {}
+        subs = set()
         for user, pats in self.ui.configitems('usersubs'):
             for pat in pats.split(','):
                 if fnmatch.fnmatch(self.repo.root, pat.strip()):
-                    subs[self.fixmail(user)] = 1
+                    subs.add(self.fixmail(user))
         for pat, users in self.ui.configitems('reposubs'):
             if fnmatch.fnmatch(self.repo.root, pat):
                 for user in users.split(','):
-                    subs[self.fixmail(user)] = 1
-        subs = util.sort(subs)
+                    subs.add(self.fixmail(user))
         return [mail.addressencode(self.ui, s, self.charsets, self.test)
-                for s in subs]
+                for s in sorted(subs)]
 
     def url(self, path=None):
         return self.ui.config('web', 'baseurl') + (path or self.root)