- skip-blame because we're just adding b''
Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
Path | Packages | |||
---|---|---|---|---|
M | tests/test-strip.t (41 lines) |
Status | Author | Revision | |
---|---|---|---|
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 |
Check that the phase cache is properly invalidated after a strip with bookmark. | Check that the phase cache is properly invalidated after a strip with bookmark. | ||||
$ cat > ../stripstalephasecache.py << EOF | $ cat > ../stripstalephasecache.py << EOF | ||||
> from mercurial import extensions, localrepo | > from mercurial import extensions, localrepo | ||||
> def transactioncallback(orig, repo, desc, *args, **kwargs): | > def transactioncallback(orig, repo, desc, *args, **kwargs): | ||||
> def test(transaction): | > def test(transaction): | ||||
> # observe cache inconsistency | > # observe cache inconsistency | ||||
> try: | > try: | ||||
> [repo.changelog.node(r) for r in repo.revs("not public()")] | > [repo.changelog.node(r) for r in repo.revs(b"not public()")] | ||||
> except IndexError: | > except IndexError: | ||||
> repo.ui.status("Index error!\n") | > repo.ui.status(b"Index error!\n") | ||||
> transaction = orig(repo, desc, *args, **kwargs) | > transaction = orig(repo, desc, *args, **kwargs) | ||||
> # warm up the phase cache | > # warm up the phase cache | ||||
> list(repo.revs("not public()")) | > list(repo.revs(b"not public()")) | ||||
> if desc != 'strip': | > if desc != 'strip': | ||||
> transaction.addpostclose("phase invalidation test", test) | > transaction.addpostclose(b"phase invalidation test", test) | ||||
> return transaction | > return transaction | ||||
> def extsetup(ui): | > def extsetup(ui): | ||||
> extensions.wrapfunction(localrepo.localrepository, "transaction", | > extensions.wrapfunction(localrepo.localrepository, b"transaction", | ||||
> transactioncallback) | > transactioncallback) | ||||
> EOF | > EOF | ||||
$ hg up -C 2 | $ hg up -C 2 | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ echo k > k | $ echo k > k | ||||
$ hg add k | $ hg add k | ||||
$ hg commit -m commitK | $ hg commit -m commitK | ||||
$ echo l > l | $ echo l > l | ||||
(They should be gracefully handled and reported) | (They should be gracefully handled and reported) | ||||
$ cat > ../crashstrip.py << EOF | $ cat > ../crashstrip.py << EOF | ||||
> from mercurial import error | > from mercurial import error | ||||
> def reposetup(ui, repo): | > def reposetup(ui, repo): | ||||
> class crashstriprepo(repo.__class__): | > class crashstriprepo(repo.__class__): | ||||
> def transaction(self, desc, *args, **kwargs): | > def transaction(self, desc, *args, **kwargs): | ||||
> tr = super(crashstriprepo, self).transaction(desc, *args, **kwargs) | > tr = super(crashstriprepo, self).transaction(desc, *args, **kwargs) | ||||
> if desc == 'strip': | > if desc == b'strip': | ||||
> def crash(tra): raise error.Abort('boom') | > def crash(tra): raise error.Abort(b'boom') | ||||
> tr.addpostclose('crash', crash) | > tr.addpostclose(b'crash', crash) | ||||
> return tr | > return tr | ||||
> repo.__class__ = crashstriprepo | > repo.__class__ = crashstriprepo | ||||
> EOF | > EOF | ||||
$ hg strip tip --config extensions.crash=$TESTTMP/crashstrip.py | $ hg strip tip --config extensions.crash=$TESTTMP/crashstrip.py | ||||
saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/5c51d8d6557d-70daef06-backup.hg | saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/5c51d8d6557d-70daef06-backup.hg | ||||
strip failed, backup bundle stored in '$TESTTMP/issue4736/.hg/strip-backup/5c51d8d6557d-70daef06-backup.hg' | strip failed, backup bundle stored in '$TESTTMP/issue4736/.hg/strip-backup/5c51d8d6557d-70daef06-backup.hg' | ||||
abort: boom | abort: boom | ||||
[255] | [255] | ||||
$ hg up -C I | $ hg up -C I | ||||
2 files updated, 0 files merged, 0 files removed, 0 files unresolved | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ echo 3 >> I | $ echo 3 >> I | ||||
$ cat > $TESTTMP/delayedstrip.py <<EOF | $ cat > $TESTTMP/delayedstrip.py <<EOF | ||||
> from __future__ import absolute_import | > from __future__ import absolute_import | ||||
> from mercurial import commands, registrar, repair | > from mercurial import commands, registrar, repair | ||||
> cmdtable = {} | > cmdtable = {} | ||||
> command = registrar.command(cmdtable) | > command = registrar.command(cmdtable) | ||||
> @command('testdelayedstrip') | > @command(b'testdelayedstrip') | ||||
> def testdelayedstrip(ui, repo): | > def testdelayedstrip(ui, repo): | ||||
> def getnodes(expr): | > def getnodes(expr): | ||||
> return [repo.changelog.node(r) for r in repo.revs(expr)] | > return [repo.changelog.node(r) for r in repo.revs(expr)] | ||||
> with repo.wlock(): | > with repo.wlock(): | ||||
> with repo.lock(): | > with repo.lock(): | ||||
> with repo.transaction('delayedstrip'): | > with repo.transaction(b'delayedstrip'): | ||||
> repair.delayedstrip(ui, repo, getnodes('B+I+Z+D+E'), 'J') | > repair.delayedstrip(ui, repo, getnodes(b'B+I+Z+D+E'), b'J') | ||||
> repair.delayedstrip(ui, repo, getnodes('G+H+Z'), 'I') | > repair.delayedstrip(ui, repo, getnodes(b'G+H+Z'), b'I') | ||||
> commands.commit(ui, repo, message='J', date='0 0') | > commands.commit(ui, repo, message=b'J', date=b'0 0') | ||||
> EOF | > EOF | ||||
$ hg testdelayedstrip --config extensions.t=$TESTTMP/delayedstrip.py | $ hg testdelayedstrip --config extensions.t=$TESTTMP/delayedstrip.py | ||||
warning: orphaned descendants detected, not stripping 08ebfeb61bac, 112478962961, 7fb047a69f22 | warning: orphaned descendants detected, not stripping 08ebfeb61bac, 112478962961, 7fb047a69f22 | ||||
saved backup bundle to $TESTTMP/delayedstrip/.hg/strip-backup/f585351a92f8-17475721-I.hg | saved backup bundle to $TESTTMP/delayedstrip/.hg/strip-backup/f585351a92f8-17475721-I.hg | ||||
$ hg log -G -T '{rev}:{node|short} {desc}' -r 'sort(all(), topo)' | $ hg log -G -T '{rev}:{node|short} {desc}' -r 'sort(all(), topo)' | ||||
@ 6:2f2d51af6205 J | @ 6:2f2d51af6205 J | ||||
| | | | ||||
$ hg bookmark -i -r H 'b-F@divergent2' | $ hg bookmark -i -r H 'b-F@divergent2' | ||||
$ hg bookmark -i -r G 'b-F@divergent3' | $ hg bookmark -i -r G 'b-F@divergent3' | ||||
$ cp -R . ../scmutilcleanup.obsstore | $ cp -R . ../scmutilcleanup.obsstore | ||||
$ cat > $TESTTMP/scmutilcleanup.py <<EOF | $ cat > $TESTTMP/scmutilcleanup.py <<EOF | ||||
> from mercurial import registrar, scmutil | > from mercurial import registrar, scmutil | ||||
> cmdtable = {} | > cmdtable = {} | ||||
> command = registrar.command(cmdtable) | > command = registrar.command(cmdtable) | ||||
> @command('testnodescleanup') | > @command(b'testnodescleanup') | ||||
> def testnodescleanup(ui, repo): | > def testnodescleanup(ui, repo): | ||||
> def nodes(expr): | > def nodes(expr): | ||||
> return [repo.changelog.node(r) for r in repo.revs(expr)] | > return [repo.changelog.node(r) for r in repo.revs(expr)] | ||||
> def node(expr): | > def node(expr): | ||||
> return nodes(expr)[0] | > return nodes(expr)[0] | ||||
> with repo.wlock(): | > with repo.wlock(): | ||||
> with repo.lock(): | > with repo.lock(): | ||||
> with repo.transaction('delayedstrip'): | > with repo.transaction(b'delayedstrip'): | ||||
> mapping = {node('F'): [node('F2')], | > mapping = {node(b'F'): [node(b'F2')], | ||||
> node('D'): [node('D2')], | > node(b'D'): [node(b'D2')], | ||||
> node('G'): [node('G2')]} | > node(b'G'): [node(b'G2')]} | ||||
> scmutil.cleanupnodes(repo, mapping, 'replace') | > scmutil.cleanupnodes(repo, mapping, b'replace') | ||||
> scmutil.cleanupnodes(repo, nodes('((B::)+I+Z)-D2'), 'replace') | > scmutil.cleanupnodes(repo, nodes(b'((B::)+I+Z)-D2'), | ||||
> b'replace') | |||||
> EOF | > EOF | ||||
$ hg testnodescleanup --config extensions.t=$TESTTMP/scmutilcleanup.py | $ hg testnodescleanup --config extensions.t=$TESTTMP/scmutilcleanup.py | ||||
warning: orphaned descendants detected, not stripping 112478962961, 1fc8102cda62, 26805aba1e60 | warning: orphaned descendants detected, not stripping 112478962961, 1fc8102cda62, 26805aba1e60 | ||||
saved backup bundle to $TESTTMP/scmutilcleanup/.hg/strip-backup/f585351a92f8-73fb7c03-replace.hg | saved backup bundle to $TESTTMP/scmutilcleanup/.hg/strip-backup/f585351a92f8-73fb7c03-replace.hg | ||||
$ hg log -G -T '{rev}:{node|short} {desc} {bookmarks}' -r 'sort(all(), topo)' | $ hg log -G -T '{rev}:{node|short} {desc} {bookmarks}' -r 'sort(all(), topo)' | ||||
o 8:1473d4b996d1 G2 b-F@divergent3 b-G | o 8:1473d4b996d1 G2 b-F@divergent3 b-G | ||||
| | | |