##// END OF EJS Templates
tests: add missing b prefix in test python in test-issue2137.t...
Augie Fackler -
r36582:c4ccc73f default
parent child Browse files
Show More
@@ -1,56 +1,56 b''
1 https://bz.mercurial-scm.org/2137
1 https://bz.mercurial-scm.org/2137
2
2
3 Setup:
3 Setup:
4
4
5 create a little extension that has 3 side-effects:
5 create a little extension that has 3 side-effects:
6 1) ensure changelog data is not inlined
6 1) ensure changelog data is not inlined
7 2) make revlog to use lazyparser
7 2) make revlog to use lazyparser
8 3) test that repo.lookup() works
8 3) test that repo.lookup() works
9 1 and 2 are preconditions for the bug; 3 is the bug.
9 1 and 2 are preconditions for the bug; 3 is the bug.
10
10
11 $ cat > commitwrapper.py <<EOF
11 $ cat > commitwrapper.py <<EOF
12 > from mercurial import extensions, node, revlog
12 > from mercurial import extensions, node, revlog
13 >
13 >
14 > def reposetup(ui, repo):
14 > def reposetup(ui, repo):
15 > class wraprepo(repo.__class__):
15 > class wraprepo(repo.__class__):
16 > def commit(self, *args, **kwargs):
16 > def commit(self, *args, **kwargs):
17 > result = super(wraprepo, self).commit(*args, **kwargs)
17 > result = super(wraprepo, self).commit(*args, **kwargs)
18 > tip1 = node.short(repo.changelog.tip())
18 > tip1 = node.short(repo.changelog.tip())
19 > tip2 = node.short(repo.lookup(tip1))
19 > tip2 = node.short(repo.lookup(tip1))
20 > assert tip1 == tip2
20 > assert tip1 == tip2
21 > ui.write('new tip: %s\n' % tip1)
21 > ui.write(b'new tip: %s\n' % tip1)
22 > return result
22 > return result
23 > repo.__class__ = wraprepo
23 > repo.__class__ = wraprepo
24 >
24 >
25 > def extsetup(ui):
25 > def extsetup(ui):
26 > revlog._maxinline = 8 # split out 00changelog.d early
26 > revlog._maxinline = 8 # split out 00changelog.d early
27 > revlog._prereadsize = 8 # use revlog.lazyparser
27 > revlog._prereadsize = 8 # use revlog.lazyparser
28 > EOF
28 > EOF
29
29
30 $ cat >> $HGRCPATH <<EOF
30 $ cat >> $HGRCPATH <<EOF
31 > [extensions]
31 > [extensions]
32 > commitwrapper = `pwd`/commitwrapper.py
32 > commitwrapper = `pwd`/commitwrapper.py
33 > EOF
33 > EOF
34
34
35 $ hg init repo1
35 $ hg init repo1
36 $ cd repo1
36 $ cd repo1
37 $ echo a > a
37 $ echo a > a
38 $ hg commit -A -m'add a with a long commit message to make the changelog a bit bigger'
38 $ hg commit -A -m'add a with a long commit message to make the changelog a bit bigger'
39 adding a
39 adding a
40 new tip: 553596fad57b
40 new tip: 553596fad57b
41
41
42 Test that new changesets are visible to repo.lookup():
42 Test that new changesets are visible to repo.lookup():
43
43
44 $ echo a >> a
44 $ echo a >> a
45 $ hg commit -m'one more commit to demonstrate the bug'
45 $ hg commit -m'one more commit to demonstrate the bug'
46 new tip: 799ae3599e0e
46 new tip: 799ae3599e0e
47
47
48 $ hg tip
48 $ hg tip
49 changeset: 1:799ae3599e0e
49 changeset: 1:799ae3599e0e
50 tag: tip
50 tag: tip
51 user: test
51 user: test
52 date: Thu Jan 01 00:00:00 1970 +0000
52 date: Thu Jan 01 00:00:00 1970 +0000
53 summary: one more commit to demonstrate the bug
53 summary: one more commit to demonstrate the bug
54
54
55
55
56 $ cd ..
56 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now