obsfate: fix user filtering in obsfate-printer stable
authorBoris Feld <boris.feld@octobus.net>
Tue, 10 Oct 2017 15:28:03 +0200
branchstable
changeset 3051 204a6947a920
parent 3050 6603d5655192
child 3052 3f85f25b36ed
obsfate: fix user filtering in obsfate-printer Only hide current user only if it's the only one that create obs-markers.
hgext3rd/evolve/templatekw.py
tests/test-evolve-templates.t
--- 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