Mercurial > public > mercurial-scm > hg
comparison mercurial/obsutil.py @ 37328:11d51e518808
obsutil: make obsfateprinter() less dependent on templater
joinfmt() is defined as 'lambda x: scmutil.formatchangeid(repo[x])' in
showsuccsandmarkers().
Function arguments are reordered so they look more normal.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Mon, 19 Mar 2018 20:32:06 +0900 |
parents | efc4fb344c05 |
children | 4455e5d4d59c |
comparison
equal
deleted
inserted
replaced
37327:ebf139cbd4a1 | 37328:11d51e518808 |
---|---|
830 operations = set(meta.get('operation') for meta in markersmeta | 830 operations = set(meta.get('operation') for meta in markersmeta |
831 if meta.get('operation')) | 831 if meta.get('operation')) |
832 | 832 |
833 return sorted(operations) | 833 return sorted(operations) |
834 | 834 |
835 def obsfateprinter(successors, markers, ui): | 835 def obsfateprinter(ui, repo, successors, markers, formatctx): |
836 """ Build a obsfate string for a single successorset using all obsfate | 836 """ Build a obsfate string for a single successorset using all obsfate |
837 related function defined in obsutil | 837 related function defined in obsutil |
838 """ | 838 """ |
839 quiet = ui.quiet | 839 quiet = ui.quiet |
840 verbose = ui.verbose | 840 verbose = ui.verbose |
850 if operations: | 850 if operations: |
851 line.append(" using %s" % ", ".join(operations)) | 851 line.append(" using %s" % ", ".join(operations)) |
852 | 852 |
853 # Successors | 853 # Successors |
854 if successors: | 854 if successors: |
855 fmtsuccessors = [successors.joinfmt(succ) for succ in successors] | 855 fmtsuccessors = [formatctx(repo[succ]) for succ in successors] |
856 line.append(" as %s" % ", ".join(fmtsuccessors)) | 856 line.append(" as %s" % ", ".join(fmtsuccessors)) |
857 | 857 |
858 # Users | 858 # Users |
859 users = markersusers(markers) | 859 users = markersusers(markers) |
860 # Filter out current user in not verbose mode to reduce amount of | 860 # Filter out current user in not verbose mode to reduce amount of |