comparison tests/test-extension @ 4074:0f9381cf9723

Try to pass repo.ui to reposetup hooks The ui object we received in this function may belong to another repo, which could be confusing from the hook point of view. Trying to use the ui object from the newly created repo should avoid this confusion.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Thu, 08 Feb 2007 16:31:21 -0200
parents 5d9ede002453
children 622d8ed78b47
comparison
equal deleted inserted replaced
4067:c620376b8fd6 4074:0f9381cf9723
5 import os 5 import os
6 from mercurial import commands 6 from mercurial import commands
7 7
8 def uisetup(ui): 8 def uisetup(ui):
9 ui.write("uisetup called\\n") 9 ui.write("uisetup called\\n")
10 ui.write("ui.parentui is%s None\\n" % (ui.parentui is not None
11 and "not" or ""))
10 12
11 def reposetup(ui, repo): 13 def reposetup(ui, repo):
12 ui.write("reposetup called for %s\\n" % os.path.basename(repo.root)) 14 ui.write("reposetup called for %s\\n" % os.path.basename(repo.root))
15 ui.write("ui %s= repo.ui\\n" % (ui == repo.ui and "=" or "!"))
13 16
14 def foo(ui, *args, **kwargs): 17 def foo(ui, *args, **kwargs):
15 ui.write("Foo\\n") 18 ui.write("Foo\\n")
16 19
17 def bar(ui, *args, **kwargs): 20 def bar(ui, *args, **kwargs):