Commits

Thomas Capricelli committed c5ef7e8

allow both email and name in exclude list
fixes #791

Comments (0)

Files changed (2)

activity/__init__.py

                  ('', 'datemin', '', _('Start date of the graph (yyyy-mm-dd)'), 'string'),
                  ('', 'datemax', '', _('End date of the graph (yyyy-mm-dd)'), 'string'),
                  ('', 'maxcaptions', 4, _('Maximum number of captions (when using --split).'), 'integer'),
-                 ('x', 'exclude', '', _('Comma-separated list of authors to ignore.'), 'string'),
+                 ('x', 'exclude', '', _('Comma-separated list of authors to ignore. You can provide either name or email.'), 'string'),
                  ('', 'aliases', '', _('file with email aliases'), 'string'),
                  ('', 'skipmerges', False, _('Do not consider merge commits')),
                  ('l', 'uselines', False, _('Use the number of lines modified instead of the number of commits')),
             continue
         if options.datemax!=None and date>options.datemax:
             continue
-        # find out who this is
+        # Ignore authors in exclude list now, whatever 
+        # is displayed
         who = node[1]
-        email = util.email(who)
-        if email in options.exclude:
+        if util.email(who) in options.exclude:
+            # ignore this commit if the email is in the exclude list
             continue
+        if person(who) in options.exclude:
+            # ignore this commit if the 'name' is in the exclude list
+            continue
+        # do it
         ctx = options.repo.changectx(i)
         for k, v in fetch_data(ctx, stat_maker, options):            
             if not data.has_key(k):