960 $ hg up -C I |
960 $ hg up -C I |
961 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
961 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
962 $ echo 3 >> I |
962 $ echo 3 >> I |
963 $ cat > $TESTTMP/delayedstrip.py <<EOF |
963 $ cat > $TESTTMP/delayedstrip.py <<EOF |
964 > from __future__ import absolute_import |
964 > from __future__ import absolute_import |
965 > from mercurial import commands, repair |
965 > from mercurial import commands, registrar, repair |
966 > def reposetup(ui, repo): |
966 > cmdtable = {} |
|
967 > command = registrar.command(cmdtable) |
|
968 > @command('testdelayedstrip') |
|
969 > def testdelayedstrip(ui, repo): |
967 > def getnodes(expr): |
970 > def getnodes(expr): |
968 > return [repo.changelog.node(r) for r in repo.revs(expr)] |
971 > return [repo.changelog.node(r) for r in repo.revs(expr)] |
969 > with repo.wlock(): |
972 > with repo.wlock(): |
970 > with repo.lock(): |
973 > with repo.lock(): |
971 > with repo.transaction('delayedstrip'): |
974 > with repo.transaction('delayedstrip'): |
972 > repair.delayedstrip(ui, repo, getnodes('B+I+Z+D+E'), 'J') |
975 > repair.delayedstrip(ui, repo, getnodes('B+I+Z+D+E'), 'J') |
973 > repair.delayedstrip(ui, repo, getnodes('G+H+Z'), 'I') |
976 > repair.delayedstrip(ui, repo, getnodes('G+H+Z'), 'I') |
974 > commands.commit(ui, repo, message='J', date='0 0') |
977 > commands.commit(ui, repo, message='J', date='0 0') |
975 > EOF |
978 > EOF |
976 $ hg log -r . -T '\n' --config extensions.t=$TESTTMP/delayedstrip.py |
979 $ hg testdelayedstrip --config extensions.t=$TESTTMP/delayedstrip.py |
977 warning: orphaned descendants detected, not stripping 08ebfeb61bac, 112478962961, 7fb047a69f22 |
980 warning: orphaned descendants detected, not stripping 08ebfeb61bac, 112478962961, 7fb047a69f22 |
978 saved backup bundle to $TESTTMP/delayedstrip/.hg/strip-backup/f585351a92f8-17475721-I.hg (glob) |
981 saved backup bundle to $TESTTMP/delayedstrip/.hg/strip-backup/f585351a92f8-17475721-I.hg (glob) |
979 |
982 |
980 $ hg log -G -T '{rev}:{node|short} {desc}' -r 'sort(all(), topo)' |
983 $ hg log -G -T '{rev}:{node|short} {desc}' -r 'sort(all(), topo)' |
981 @ 6:2f2d51af6205 J |
984 @ 6:2f2d51af6205 J |
982 | |
985 | |
983 o 3:08ebfeb61bac I |
986 o 3:08ebfeb61bac I |
984 | |
987 | |
1007 $ hg bookmark -i -r H 'b-F@divergent2' |
1010 $ hg bookmark -i -r H 'b-F@divergent2' |
1008 $ hg bookmark -i -r G 'b-F@divergent3' |
1011 $ hg bookmark -i -r G 'b-F@divergent3' |
1009 $ cp -R . ../scmutilcleanup.obsstore |
1012 $ cp -R . ../scmutilcleanup.obsstore |
1010 |
1013 |
1011 $ cat > $TESTTMP/scmutilcleanup.py <<EOF |
1014 $ cat > $TESTTMP/scmutilcleanup.py <<EOF |
1012 > from mercurial import scmutil |
1015 > from mercurial import registrar, scmutil |
1013 > def reposetup(ui, repo): |
1016 > cmdtable = {} |
|
1017 > command = registrar.command(cmdtable) |
|
1018 > @command('testnodescleanup') |
|
1019 > def testnodescleanup(ui, repo): |
1014 > def nodes(expr): |
1020 > def nodes(expr): |
1015 > return [repo.changelog.node(r) for r in repo.revs(expr)] |
1021 > return [repo.changelog.node(r) for r in repo.revs(expr)] |
1016 > def node(expr): |
1022 > def node(expr): |
1017 > return nodes(expr)[0] |
1023 > return nodes(expr)[0] |
1018 > with repo.wlock(): |
1024 > with repo.wlock(): |
1022 > node('D'): [node('D2')], |
1028 > node('D'): [node('D2')], |
1023 > node('G'): [node('G2')]} |
1029 > node('G'): [node('G2')]} |
1024 > scmutil.cleanupnodes(repo, mapping, 'replace') |
1030 > scmutil.cleanupnodes(repo, mapping, 'replace') |
1025 > scmutil.cleanupnodes(repo, nodes('((B::)+I+Z)-D2'), 'replace') |
1031 > scmutil.cleanupnodes(repo, nodes('((B::)+I+Z)-D2'), 'replace') |
1026 > EOF |
1032 > EOF |
1027 $ hg log -r . -T '\n' --config extensions.t=$TESTTMP/scmutilcleanup.py |
1033 $ hg testnodescleanup --config extensions.t=$TESTTMP/scmutilcleanup.py |
1028 warning: orphaned descendants detected, not stripping 112478962961, 1fc8102cda62, 26805aba1e60 |
1034 warning: orphaned descendants detected, not stripping 112478962961, 1fc8102cda62, 26805aba1e60 |
1029 saved backup bundle to $TESTTMP/scmutilcleanup/.hg/strip-backup/f585351a92f8-73fb7c03-replace.hg (glob) |
1035 saved backup bundle to $TESTTMP/scmutilcleanup/.hg/strip-backup/f585351a92f8-73fb7c03-replace.hg (glob) |
1030 |
1036 |
1031 $ hg log -G -T '{rev}:{node|short} {desc} {bookmarks}' -r 'sort(all(), topo)' |
1037 $ hg log -G -T '{rev}:{node|short} {desc} {bookmarks}' -r 'sort(all(), topo)' |
1032 o 8:1473d4b996d1 G2 b-F@divergent3 b-G |
1038 o 8:1473d4b996d1 G2 b-F@divergent3 b-G |
1033 | |
1039 | |
1034 | o 7:d11b3456a873 F2 b-F |
1040 | o 7:d11b3456a873 F2 b-F |
1035 | | |
1041 | | |
1066 > [experimental] |
1072 > [experimental] |
1067 > stabilization=all |
1073 > stabilization=all |
1068 > stabilization.track-operation=1 |
1074 > stabilization.track-operation=1 |
1069 > EOF |
1075 > EOF |
1070 |
1076 |
1071 $ hg log -r . -T '\n' --config extensions.t=$TESTTMP/scmutilcleanup.py |
1077 $ hg testnodescleanup --config extensions.t=$TESTTMP/scmutilcleanup.py |
1072 |
1078 |
1073 $ rm .hg/localtags |
1079 $ rm .hg/localtags |
1074 $ hg log -G -T '{rev}:{node|short} {desc} {bookmarks}' -r 'sort(all(), topo)' |
1080 $ hg log -G -T '{rev}:{node|short} {desc} {bookmarks}' -r 'sort(all(), topo)' |
1075 o 12:1473d4b996d1 G2 b-F@divergent3 b-G |
1081 o 12:1473d4b996d1 G2 b-F@divergent3 b-G |
1076 | |
1082 | |
1077 | o 11:d11b3456a873 F2 b-F |
1083 | o 11:d11b3456a873 F2 b-F |