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