comparison tests/test-extension @ 4064:5d9ede002453

install reposetup hook right after loading the extension
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Tue, 06 Feb 2007 15:43:01 -0200
parents
children 0f9381cf9723
comparison
equal deleted inserted replaced
4063:96863fc3036a 4064:5d9ede002453
1 #!/bin/sh
2 # Test basic extension support
3
4 cat > foobar.py <<EOF
5 import os
6 from mercurial import commands
7
8 def uisetup(ui):
9 ui.write("uisetup called\\n")
10
11 def reposetup(ui, repo):
12 ui.write("reposetup called for %s\\n" % os.path.basename(repo.root))
13
14 def foo(ui, *args, **kwargs):
15 ui.write("Foo\\n")
16
17 def bar(ui, *args, **kwargs):
18 ui.write("Bar\\n")
19
20 cmdtable = {
21 "foo": (foo, [], "hg foo"),
22 "bar": (bar, [], "hg bar"),
23 }
24
25 commands.norepo += ' bar'
26 EOF
27 abspath=`pwd`/foobar.py
28
29 hg init a
30 cd a
31 echo foo > file
32 hg add file
33 hg commit -m 'add file'
34
35 echo '[extensions]' >> $HGRCPATH
36 echo "foobar = $abspath" >> $HGRCPATH
37 hg foo
38
39 cd ..
40 hg clone a b
41
42 hg bar