changeset 3051:204a6947a920 stable

obsfate: fix user filtering in obsfate-printer Only hide current user only if it's the only one that create obs-markers.
author Boris Feld <boris.feld@octobus.net>
date Tue, 10 Oct 2017 15:28:03 +0200
parents 6603d5655192
children 3f85f25b36ed
files hgext3rd/evolve/templatekw.py tests/test-evolve-templates.t
diffstat 2 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/templatekw.py	Tue Oct 10 16:22:21 2017 +0200
+++ b/hgext3rd/evolve/templatekw.py	Tue Oct 10 15:28:03 2017 +0200
@@ -195,9 +195,12 @@
     if (verbose or normal) and 'users' in obsfateline:
         users = obsfateline['users']
 
-        if normal:
+        if not verbose:
+            # If current user is the only user, do not show anything if not in
+            # verbose mode
             username = _getusername(ui)
-            users = [user for user in users if user != username]
+            if len(users) == 1 and users[0] == username:
+                users = None
 
         if users:
             line.append(" by %s" % ",".join(users))
--- a/tests/test-evolve-templates.t	Tue Oct 10 16:22:21 2017 +0200
+++ b/tests/test-evolve-templates.t	Tue Oct 10 15:28:03 2017 +0200
@@ -107,7 +107,7 @@
   | @  changeset:   1:471f378eab4c
   |/   user:        test
   |    date:        Thu Jan 01 00:00:00 1970 +0000
-  |    obsolete:    rewritten by test2 as d004c8f274b9
+  |    obsolete:    rewritten by test,test2 as d004c8f274b9
   |    summary:     A0
   |
   o  changeset:   0:ea207398892e