changeset 8154:06f1e4e309ed

notify: turned a set-like dict into a real set
author Martin Geisler <mg@lazybytes.net>
date Fri, 24 Apr 2009 17:32:18 +0200
parents 616f20e1004a
children b7cdfa2527be
files hgext/notify.py
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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)