comparison mercurial/scmutil.py @ 39916:1857f50a9643

cleanupnodes: drop special casing around prune markers (API) The `cleanupnodes` has logic to skip the creation of "prune" markers if the changeset is already obsolete. This feels strange and gets in the way of code changes to tracks folds. Now that callers no longer request such prune, we can drop this logic. In many cases, pruning through cleanupnodes should be replaced by internal phase usage.
author Boris Feld <boris.feld@octobus.net>
date Wed, 26 Sep 2018 21:28:21 +0200
parents a89dd6d01df0
children 61f39a892168
comparison
equal deleted inserted replaced
39915:7198cdbbbde1 39916:1857f50a9643
978 # without a successor, skip that obssolete request since it's 978 # without a successor, skip that obssolete request since it's
979 # unnecessary. That's the "if s or not isobs(n)" check below. 979 # unnecessary. That's the "if s or not isobs(n)" check below.
980 # Also sort the node in topology order, that might be useful for 980 # Also sort the node in topology order, that might be useful for
981 # some obsstore logic. 981 # some obsstore logic.
982 # NOTE: the filtering and sorting might belong to createmarkers. 982 # NOTE: the filtering and sorting might belong to createmarkers.
983 isobs = unfi.obsstore.successors.__contains__
984 torev = unfi.changelog.rev 983 torev = unfi.changelog.rev
985 sortfunc = lambda ns: torev(ns[0][0]) 984 sortfunc = lambda ns: torev(ns[0][0])
986 rels = [] 985 rels = []
987 for ns, s in sorted(replacements.items(), key=sortfunc): 986 for ns, s in sorted(replacements.items(), key=sortfunc):
988 for n in ns: 987 for n in ns:
989 if s or not isobs(n): 988 rel = (unfi[n], tuple(unfi[m] for m in s))
990 rel = (unfi[n], tuple(unfi[m] for m in s)) 989 rels.append(rel)
991 rels.append(rel)
992 if rels: 990 if rels:
993 obsolete.createmarkers(repo, rels, operation=operation, 991 obsolete.createmarkers(repo, rels, operation=operation,
994 metadata=metadata) 992 metadata=metadata)
995 else: 993 else:
996 from . import repair # avoid import cycle 994 from . import repair # avoid import cycle