Mercurial > hg
annotate tests/test-context-metadata.t @ 41793:2e92624c3613 stable
test: update test-sparse-revlog.t output
This test is skipped unless a large artefact is pre-build. It seems like nobody
ran it in a while. Changeset 3764330f76a6 changed the expected output but
nobody noticed.
This changeset focus on the first and simpler step: putting the expected output
back to what one would get by running this test.
However this test changes highlight a couple of deeper issues:
1) Even if the revision content did not changed, a change in the delta
contained in the bundle affected the delta stored in the final revlog, changing
the test result. Since we are testing the delta computation strategy with
sparse, we should not blindly reuse the delta-base from the bundled delta.
2) A change in the format of the repository used to generate the bundle changed
the delta stored in the bundle. We should get a more stable output to avoid
future instabilities of this test.
3) The test is it not run by CI or developer.
We'll try to address all this issues in the coming changesets.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sun, 24 Feb 2019 19:56:57 +0100 |
parents | b8db53f786f0 |
children | 42d2b31cee0b |
rev | line source |
---|---|
33999
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
1 Tests about metadataonlyctx |
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
2 |
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
3 $ hg init |
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
4 $ echo A > A |
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
5 $ hg commit -A A -m 'Add A' |
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
6 $ echo B > B |
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
7 $ hg commit -A B -m 'Add B' |
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
8 $ hg rm A |
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
9 $ echo C > C |
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
10 $ echo B2 > B |
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
11 $ hg add C -q |
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
12 $ hg commit -m 'Remove A' |
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
13 |
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
14 $ cat > metaedit.py <<EOF |
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
15 > from __future__ import absolute_import |
36048
194463554ba5
py3: port metaedit extension to Python 3
Gregory Szorc <gregory.szorc@gmail.com>
parents:
34061
diff
changeset
|
16 > from mercurial import context, pycompat, registrar |
33999
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
17 > cmdtable = {} |
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
18 > command = registrar.command(cmdtable) |
36048
194463554ba5
py3: port metaedit extension to Python 3
Gregory Szorc <gregory.szorc@gmail.com>
parents:
34061
diff
changeset
|
19 > @command(b'metaedit') |
33999
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
20 > def metaedit(ui, repo, arg): |
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
21 > # Modify commit message to "FOO" |
36048
194463554ba5
py3: port metaedit extension to Python 3
Gregory Szorc <gregory.szorc@gmail.com>
parents:
34061
diff
changeset
|
22 > with repo.wlock(), repo.lock(), repo.transaction(b'metaedit'): |
194463554ba5
py3: port metaedit extension to Python 3
Gregory Szorc <gregory.szorc@gmail.com>
parents:
34061
diff
changeset
|
23 > old = repo[b'.'] |
194463554ba5
py3: port metaedit extension to Python 3
Gregory Szorc <gregory.szorc@gmail.com>
parents:
34061
diff
changeset
|
24 > kwargs = dict(s.split(b'=', 1) for s in arg.split(b';')) |
40303
b8db53f786f0
tests: add missing b prefix in test-context-metadata.t
Augie Fackler <augie@google.com>
parents:
37851
diff
changeset
|
25 > if b'parents' in kwargs: |
37851
8327fd79adf8
tests: pass parent revision as integer to repo[x] in test-context-metadata.t
Martin von Zweigbergk <martinvonz@google.com>
parents:
36048
diff
changeset
|
26 > kwargs[b'parents'] = map(int, kwargs[b'parents'].split(b',')) |
36048
194463554ba5
py3: port metaedit extension to Python 3
Gregory Szorc <gregory.szorc@gmail.com>
parents:
34061
diff
changeset
|
27 > new = context.metadataonlyctx(repo, old, |
194463554ba5
py3: port metaedit extension to Python 3
Gregory Szorc <gregory.szorc@gmail.com>
parents:
34061
diff
changeset
|
28 > **pycompat.strkwargs(kwargs)) |
33999
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
29 > new.commit() |
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
30 > EOF |
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
31 $ hg --config extensions.metaedit=$TESTTMP/metaedit.py metaedit 'text=Changed' |
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
32 $ hg log -r tip |
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
33 changeset: 3:ad83e9e00ec9 |
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
34 tag: tip |
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
35 parent: 1:3afb7afe6632 |
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
36 user: test |
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
37 date: Thu Jan 01 00:00:00 1970 +0000 |
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
38 summary: Changed |
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
39 |
34061
11499bad0359
check-code: forbid "\S" in egrep regular expression
Jun Wu <quark@fb.com>
parents:
33999
diff
changeset
|
40 $ hg --config extensions.metaedit=$TESTTMP/metaedit.py metaedit 'parents=0' 2>&1 | egrep '^RuntimeError' |
33999
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
41 RuntimeError: can't reuse the manifest: its p1 doesn't match the new ctx p1 |
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
42 |
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
43 $ hg --config extensions.metaedit=$TESTTMP/metaedit.py metaedit 'user=foo <foo@example.com>' |
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
44 $ hg log -r tip |
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
45 changeset: 4:1f86eaeca92b |
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
46 tag: tip |
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
47 parent: 1:3afb7afe6632 |
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
48 user: foo <foo@example.com> |
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
49 date: Thu Jan 01 00:00:00 1970 +0000 |
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
50 summary: Remove A |
be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
51 |