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