diff mercurial/obsutil.py @ 34012:38f08eaba6b0

template: compute user in obsfateusers Extract, deduplicate users informations from obs markers in order to display them. Print all users for the moment, we might want to display users only in verbose mode later.
author Boris Feld <boris.feld@octobus.net>
date Mon, 03 Jul 2017 15:34:00 +0200
parents 3d0f8918351b
children c35c0f54f420
line wrap: on
line diff
--- a/mercurial/obsutil.py	Mon Jul 03 15:33:27 2017 +0200
+++ b/mercurial/obsutil.py	Mon Jul 03 15:34:00 2017 +0200
@@ -601,3 +601,11 @@
     else:
         verb = 'split'
     return verb
+
+def markersusers(markers):
+    """ Returns a sorted list of markers users without duplicates
+    """
+    markersmeta = [dict(m[3]) for m in markers]
+    users = set(meta.get('user') for meta in markersmeta if meta.get('user'))
+
+    return sorted(users)