comparison mercurial/obsutil.py @ 34850:62a4ccf9784a

obsfate: filter out current user if not in verbose Obsolescence is sometimes used only locally so the obs-marker users is always the same. Showing the user in this case does not bring much values. In the case where multiple users rewrite the commit, display the full list of users. Also show all users in verbose mode.
author Boris Feld <boris.feld@octobus.net>
date Mon, 09 Oct 2017 15:34:12 +0200
parents e27f1f04c2cf
children 6f53a53245a2
comparison
equal deleted inserted replaced
34849:9f2891fb426c 34850:62a4ccf9784a
786 786
787 def obsfateprinter(successors, markers, ui): 787 def obsfateprinter(successors, markers, ui):
788 """ Build a obsfate string for a single successorset using all obsfate 788 """ Build a obsfate string for a single successorset using all obsfate
789 related function defined in obsutil 789 related function defined in obsutil
790 """ 790 """
791 quiet = ui.quiet
792 verbose = ui.verbose
793 normal = not verbose and not quiet
794
791 line = [] 795 line = []
792 796
793 # Verb 797 # Verb
794 line.append(successorsetverb(successors)) 798 line.append(successorsetverb(successors))
795 799
803 fmtsuccessors = [successors.joinfmt(succ) for succ in successors] 807 fmtsuccessors = [successors.joinfmt(succ) for succ in successors]
804 line.append(" as %s" % ", ".join(fmtsuccessors)) 808 line.append(" as %s" % ", ".join(fmtsuccessors))
805 809
806 # Users 810 # Users
807 users = markersusers(markers) 811 users = markersusers(markers)
808 812 # Filter out current user in not verbose mode to reduce amount of
809 if users: 813 # information
814 if not verbose:
815 currentuser = ui.username(acceptempty=True)
816 if len(users) == 1 and currentuser in users:
817 users = None
818
819 if (verbose or normal) and users:
810 line.append(" by %s" % ", ".join(users)) 820 line.append(" by %s" % ", ".join(users))
811 821
812 # Date 822 # Date
813 dates = markersdates(markers) 823 dates = markersdates(markers)
814 824