comparison tests/test-issue2137.t @ 12204:c55d69c5fb77

tests: unify test-issue1438 and test-issue2137
author Adrian Buehlmann <adrian@cadifra.com>
date Fri, 10 Sep 2010 17:59:17 +0200
parents tests/test-issue2137@6bbe4886740e
children b63f6422d2a7
comparison
equal deleted inserted replaced
12202:d346089095ac 12204:c55d69c5fb77
1 # http://mercurial.selenic.com/bts/issue2137
2
3 Setup:
4
5 # create a little extension that has 3 side-effects:
6 # 1) ensure changelog data is not inlined
7 # 2) make revlog to use lazyparser
8 # 3) test that repo.lookup() works
9 # 1 and 2 are preconditions for the bug; 3 is the bug.
10
11 $ cat > commitwrapper.py <<EOF
12 > from mercurial import extensions, node, revlog
13 >
14 > def reposetup(ui, repo):
15 > def wrapcommit(orig, *args, **kwargs):
16 > result = orig(*args, **kwargs)
17 > tip1 = node.short(repo.changelog.tip())
18 > tip2 = node.short(repo.lookup(tip1))
19 > assert tip1 == tip2
20 > ui.write('new tip: %s\n' % tip1)
21 > return result
22 >
23 > extensions.wrapfunction(repo, 'commit', wrapcommit)
24 >
25 > def extsetup(ui):
26 > revlog._maxinline = 8 # split out 00changelog.d early
27 > revlog._prereadsize = 8 # use revlog.lazyparser
28 > EOF
29
30 $ cat >> $HGRCPATH <<EOF
31 > [extensions]
32 > commitwrapper = `pwd`/commitwrapper.py
33 > EOF
34
35 $ hg init repo1
36 $ cd repo1
37 $ echo a > a
38 $ hg commit -A -m'add a with a long commit message to make the changelog a bit bigger'
39 adding a
40 new tip: 553596fad57b
41
42
43 Test that new changesets are visible to repo.lookup():
44
45 $ echo a >> a
46 $ hg commit -m'one more commit to demonstrate the bug'
47 new tip: 799ae3599e0e
48
49 $ hg tip
50 changeset: 1:799ae3599e0e
51 tag: tip
52 user: test
53 date: Thu Jan 01 00:00:00 1970 +0000
54 summary: one more commit to demonstrate the bug
55
56