Show More
@@ -893,17 +893,17 b' Check that the phase cache is properly i' | |||
|
893 | 893 | > def test(transaction): |
|
894 | 894 | > # observe cache inconsistency |
|
895 | 895 | > try: |
|
896 | > [repo.changelog.node(r) for r in repo.revs("not public()")] | |
|
896 | > [repo.changelog.node(r) for r in repo.revs(b"not public()")] | |
|
897 | 897 | > except IndexError: |
|
898 | > repo.ui.status("Index error!\n") | |
|
898 | > repo.ui.status(b"Index error!\n") | |
|
899 | 899 | > transaction = orig(repo, desc, *args, **kwargs) |
|
900 | 900 | > # warm up the phase cache |
|
901 | > list(repo.revs("not public()")) | |
|
901 | > list(repo.revs(b"not public()")) | |
|
902 | 902 | > if desc != 'strip': |
|
903 | > transaction.addpostclose("phase invalidation test", test) | |
|
903 | > transaction.addpostclose(b"phase invalidation test", test) | |
|
904 | 904 | > return transaction |
|
905 | 905 | > def extsetup(ui): |
|
906 | > extensions.wrapfunction(localrepo.localrepository, "transaction", | |
|
906 | > extensions.wrapfunction(localrepo.localrepository, b"transaction", | |
|
907 | 907 | > transactioncallback) |
|
908 | 908 | > EOF |
|
909 | 909 | $ hg up -C 2 |
@@ -930,9 +930,9 b' Error during post-close callback of the ' | |||
|
930 | 930 | > class crashstriprepo(repo.__class__): |
|
931 | 931 | > def transaction(self, desc, *args, **kwargs): |
|
932 | 932 | > tr = super(crashstriprepo, self).transaction(desc, *args, **kwargs) |
|
933 | > if desc == 'strip': | |
|
934 | > def crash(tra): raise error.Abort('boom') | |
|
935 | > tr.addpostclose('crash', crash) | |
|
933 | > if desc == b'strip': | |
|
934 | > def crash(tra): raise error.Abort(b'boom') | |
|
935 | > tr.addpostclose(b'crash', crash) | |
|
936 | 936 | > return tr |
|
937 | 937 | > repo.__class__ = crashstriprepo |
|
938 | 938 | > EOF |
@@ -1175,16 +1175,16 b' Use delayedstrip to strip inside a trans' | |||
|
1175 | 1175 | > from mercurial import commands, registrar, repair |
|
1176 | 1176 | > cmdtable = {} |
|
1177 | 1177 | > command = registrar.command(cmdtable) |
|
1178 | > @command('testdelayedstrip') | |
|
1178 | > @command(b'testdelayedstrip') | |
|
1179 | 1179 | > def testdelayedstrip(ui, repo): |
|
1180 | 1180 | > def getnodes(expr): |
|
1181 | 1181 | > return [repo.changelog.node(r) for r in repo.revs(expr)] |
|
1182 | 1182 | > with repo.wlock(): |
|
1183 | 1183 | > with repo.lock(): |
|
1184 | > with repo.transaction('delayedstrip'): | |
|
1185 | > repair.delayedstrip(ui, repo, getnodes('B+I+Z+D+E'), 'J') | |
|
1186 | > repair.delayedstrip(ui, repo, getnodes('G+H+Z'), 'I') | |
|
1187 | > commands.commit(ui, repo, message='J', date='0 0') | |
|
1184 | > with repo.transaction(b'delayedstrip'): | |
|
1185 | > repair.delayedstrip(ui, repo, getnodes(b'B+I+Z+D+E'), b'J') | |
|
1186 | > repair.delayedstrip(ui, repo, getnodes(b'G+H+Z'), b'I') | |
|
1187 | > commands.commit(ui, repo, message=b'J', date=b'0 0') | |
|
1188 | 1188 | > EOF |
|
1189 | 1189 | $ hg testdelayedstrip --config extensions.t=$TESTTMP/delayedstrip.py |
|
1190 | 1190 | warning: orphaned descendants detected, not stripping 08ebfeb61bac, 112478962961, 7fb047a69f22 |
@@ -1225,7 +1225,7 b' Test high-level scmutil.cleanupnodes API' | |||
|
1225 | 1225 | > from mercurial import registrar, scmutil |
|
1226 | 1226 | > cmdtable = {} |
|
1227 | 1227 | > command = registrar.command(cmdtable) |
|
1228 | > @command('testnodescleanup') | |
|
1228 | > @command(b'testnodescleanup') | |
|
1229 | 1229 | > def testnodescleanup(ui, repo): |
|
1230 | 1230 | > def nodes(expr): |
|
1231 | 1231 | > return [repo.changelog.node(r) for r in repo.revs(expr)] |
@@ -1233,12 +1233,13 b' Test high-level scmutil.cleanupnodes API' | |||
|
1233 | 1233 | > return nodes(expr)[0] |
|
1234 | 1234 | > with repo.wlock(): |
|
1235 | 1235 | > with repo.lock(): |
|
1236 | > with repo.transaction('delayedstrip'): | |
|
1237 | > mapping = {node('F'): [node('F2')], | |
|
1238 | > node('D'): [node('D2')], | |
|
1239 | > node('G'): [node('G2')]} | |
|
1240 | > scmutil.cleanupnodes(repo, mapping, 'replace') | |
|
1241 |
> scmutil.cleanupnodes(repo, nodes('((B::)+I+Z)-D2'), |
|
|
1236 | > with repo.transaction(b'delayedstrip'): | |
|
1237 | > mapping = {node(b'F'): [node(b'F2')], | |
|
1238 | > node(b'D'): [node(b'D2')], | |
|
1239 | > node(b'G'): [node(b'G2')]} | |
|
1240 | > scmutil.cleanupnodes(repo, mapping, b'replace') | |
|
1241 | > scmutil.cleanupnodes(repo, nodes(b'((B::)+I+Z)-D2'), | |
|
1242 | > b'replace') | |
|
1242 | 1243 | > EOF |
|
1243 | 1244 | $ hg testnodescleanup --config extensions.t=$TESTTMP/scmutilcleanup.py |
|
1244 | 1245 | warning: orphaned descendants detected, not stripping 112478962961, 1fc8102cda62, 26805aba1e60 |
General Comments 0
You need to be logged in to leave comments.
Login now