diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py --- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -980,15 +980,13 @@ def cleanupnodes(repo, replacements, ope # Also sort the node in topology order, that might be useful for # some obsstore logic. # NOTE: the filtering and sorting might belong to createmarkers. - isobs = unfi.obsstore.successors.__contains__ torev = unfi.changelog.rev sortfunc = lambda ns: torev(ns[0][0]) rels = [] for ns, s in sorted(replacements.items(), key=sortfunc): for n in ns: - if s or not isobs(n): - rel = (unfi[n], tuple(unfi[m] for m in s)) - rels.append(rel) + rel = (unfi[n], tuple(unfi[m] for m in s)) + rels.append(rel) if rels: obsolete.createmarkers(repo, rels, operation=operation, metadata=metadata) diff --git a/tests/test-strip.t b/tests/test-strip.t --- a/tests/test-strip.t +++ b/tests/test-strip.t @@ -1246,7 +1246,7 @@ Test high-level scmutil.cleanupnodes API > node(b'D'): [node(b'D2')], > node(b'G'): [node(b'G2')]} > scmutil.cleanupnodes(repo, mapping, b'replace') - > scmutil.cleanupnodes(repo, nodes(b'((B::)+I+Z)-D2'), + > scmutil.cleanupnodes(repo, nodes(b'((B::)+I+Z)-D2-obsolete()'), > b'replace') > EOF $ hg testnodescleanup --config extensions.t=$TESTTMP/scmutilcleanup.py