Show More
@@ -442,8 +442,7 b' def _filterederror(repo, changeid):' | |||
|
442 | 442 | # If the changeset is obsolete, enrich the message with the reason |
|
443 | 443 | # that made this changeset not visible |
|
444 | 444 | if ctx.obsolete(): |
|
445 |
|
|
|
446 | msg = _("hidden revision '%s' %s") % (changeid, reason) | |
|
445 | msg = obsutil._getfilteredreason(unfilteredrepo, changeid, ctx) | |
|
447 | 446 | else: |
|
448 | 447 | msg = _("hidden revision '%s'") % changeid |
|
449 | 448 |
@@ -865,7 +865,17 b' def obsfateprinter(successors, markers, ' | |||
|
865 | 865 | |
|
866 | 866 | return "".join(line) |
|
867 | 867 | |
|
868 | def _getfilteredreason(unfilteredrepo, ctx): | |
|
868 | ||
|
869 | filteredmsgtable = { | |
|
870 | "pruned": _("hidden revision '%s' is pruned"), | |
|
871 | "diverged": _("hidden revision '%s' has diverged"), | |
|
872 | "superseded": _("hidden revision '%s' was rewritten as: %s"), | |
|
873 | "superseded_split": _("hidden revision '%s' was split as: %s"), | |
|
874 | "superseded_split_several": _("hidden revision '%s' was split as: %s and " | |
|
875 | "%d more"), | |
|
876 | } | |
|
877 | ||
|
878 | def _getfilteredreason(unfilteredrepo, changeid, ctx): | |
|
869 | 879 | """return a human-friendly string on why a obsolete changeset is hidden |
|
870 | 880 | """ |
|
871 | 881 | successors = successorssets(unfilteredrepo, ctx.node()) |
@@ -873,11 +883,12 b' def _getfilteredreason(unfilteredrepo, c' | |||
|
873 | 883 | |
|
874 | 884 | # Be more precise in case the revision is superseded |
|
875 | 885 | if fate == 'pruned': |
|
876 | reason = _('is pruned') | |
|
886 | return filteredmsgtable['pruned'] % changeid | |
|
877 | 887 | elif fate == 'diverged': |
|
878 | reason = _('has diverged') | |
|
888 | return filteredmsgtable['diverged'] % changeid | |
|
879 | 889 | elif fate == 'superseded': |
|
880 |
|
|
|
890 | single_successor = nodemod.short(successors[0][0]) | |
|
891 | return filteredmsgtable['superseded'] % (changeid, single_successor) | |
|
881 | 892 | elif fate == 'superseded_split': |
|
882 | 893 | |
|
883 | 894 | succs = [] |
@@ -885,13 +896,11 b' def _getfilteredreason(unfilteredrepo, c' | |||
|
885 | 896 | succs.append(nodemod.short(node_id)) |
|
886 | 897 | |
|
887 | 898 | if len(succs) <= 2: |
|
888 |
|
|
|
899 | fmtsuccs = ', '.join(succs) | |
|
900 | return filteredmsgtable['superseded_split'] % (changeid, fmtsuccs) | |
|
889 | 901 | else: |
|
890 |
firstsuccessors = |
|
|
902 | firstsuccessors = ', '.join(succs[:2]) | |
|
891 | 903 | remainingnumber = len(succs) - 2 |
|
892 | 904 | |
|
893 | args = (firstsuccessors, remainingnumber) | |
|
894 | successorsmsg = _("%s and %d more") % args | |
|
895 | reason = _("was split as: %s") % successorsmsg | |
|
896 | ||
|
897 | return reason | |
|
905 | args = (changeid, firstsuccessors, remainingnumber) | |
|
906 | return filteredmsgtable['superseded_split_several'] % args |
General Comments 0
You need to be logged in to leave comments.
Login now