Show More
@@ -980,15 +980,13 b' def cleanupnodes(repo, replacements, ope' | |||||
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) |
@@ -1246,7 +1246,7 b' Test high-level scmutil.cleanupnodes API' | |||||
1246 | > node(b'D'): [node(b'D2')], |
|
1246 | > node(b'D'): [node(b'D2')], | |
1247 | > node(b'G'): [node(b'G2')]} |
|
1247 | > node(b'G'): [node(b'G2')]} | |
1248 | > scmutil.cleanupnodes(repo, mapping, b'replace') |
|
1248 | > scmutil.cleanupnodes(repo, mapping, b'replace') | |
1249 | > scmutil.cleanupnodes(repo, nodes(b'((B::)+I+Z)-D2'), |
|
1249 | > scmutil.cleanupnodes(repo, nodes(b'((B::)+I+Z)-D2-obsolete()'), | |
1250 | > b'replace') |
|
1250 | > b'replace') | |
1251 | > EOF |
|
1251 | > EOF | |
1252 | $ hg testnodescleanup --config extensions.t=$TESTTMP/scmutilcleanup.py |
|
1252 | $ hg testnodescleanup --config extensions.t=$TESTTMP/scmutilcleanup.py |
General Comments 0
You need to be logged in to leave comments.
Login now