Show More
@@ -962,8 +962,11 b' Use delayedstrip to strip inside a trans' | |||||
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(): | |
@@ -973,10 +976,10 b' Use delayedstrip to strip inside a trans' | |||||
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 |
|
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 | | | |
@@ -1009,8 +1012,11 b' Test high-level scmutil.cleanupnodes API' | |||||
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): | |
@@ -1024,10 +1030,10 b' Test high-level scmutil.cleanupnodes API' | |||||
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 |
|
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 | | | |
@@ -1068,8 +1074,8 b' we have reusable code here' | |||||
1068 | > stabilization.track-operation=1 |
|
1074 | > stabilization.track-operation=1 | |
1069 | > EOF |
|
1075 | > EOF | |
1070 |
|
1076 | |||
1071 |
$ hg |
|
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 |
General Comments 0
You need to be logged in to leave comments.
Login now