Show More
@@ -100,10 +100,10 b' def loglimit(opts):' | |||
|
100 | 100 | |
|
101 | 101 | def remoteui(src, opts): |
|
102 | 102 | 'build a remote ui from ui or repo and opts' |
|
103 | if hasattr(src, 'ui'): # looks like a repository | |
|
104 |
dst = src. |
|
|
103 | if hasattr(src, 'baseui'): # looks like a repository | |
|
104 | dst = src.baseui # drop repo-specific config | |
|
105 | 105 | src = src.ui # copy target options from repo |
|
106 | else: # assume it's a ui object | |
|
106 | else: # assume it's a global ui object | |
|
107 | 107 | dst = src # keep all global options |
|
108 | 108 | |
|
109 | 109 | # copy ssh-specific options |
@@ -2677,7 +2677,7 b' def serve(ui, repo, **opts):' | |||
|
2677 | 2677 | s = sshserver.sshserver(ui, repo) |
|
2678 | 2678 | s.serve_forever() |
|
2679 | 2679 | |
|
2680 |
parentui = |
|
|
2680 | parentui = repo and repo.baseui or ui | |
|
2681 | 2681 | optlist = ("name templates style address port prefix ipv6" |
|
2682 | 2682 | " accesslog errorlog webdir_conf certificate") |
|
2683 | 2683 | for o in optlist.split(): |
@@ -20,7 +20,7 b' class localrepository(repo.repository):' | |||
|
20 | 20 | capabilities = set(('lookup', 'changegroupsubset')) |
|
21 | 21 | supported = ('revlogv1', 'store', 'fncache') |
|
22 | 22 | |
|
23 |
def __init__(self, |
|
|
23 | def __init__(self, baseui, path=None, create=0): | |
|
24 | 24 | repo.repository.__init__(self) |
|
25 | 25 | self.root = os.path.realpath(path) |
|
26 | 26 | self.path = os.path.join(self.root, ".hg") |
@@ -34,10 +34,10 b' class localrepository(repo.repository):' | |||
|
34 | 34 | os.mkdir(path) |
|
35 | 35 | os.mkdir(self.path) |
|
36 | 36 | requirements = ["revlogv1"] |
|
37 |
if |
|
|
37 | if baseui.configbool('format', 'usestore', True): | |
|
38 | 38 | os.mkdir(os.path.join(self.path, "store")) |
|
39 | 39 | requirements.append("store") |
|
40 |
if |
|
|
40 | if baseui.configbool('format', 'usefncache', True): | |
|
41 | 41 | requirements.append("fncache") |
|
42 | 42 | # create an invalid changelog |
|
43 | 43 | self.opener("00changelog.i", "a").write( |
@@ -70,7 +70,8 b' class localrepository(repo.repository):' | |||
|
70 | 70 | self.sjoin = self.store.join |
|
71 | 71 | self.opener.createmode = self.store.createmode |
|
72 | 72 | |
|
73 | self.ui = ui.ui(parentui=parentui) | |
|
73 | self.baseui = baseui | |
|
74 | self.ui = baseui.copy() | |
|
74 | 75 | try: |
|
75 | 76 | self.ui.readconfig(self.join("hgrc"), self.root) |
|
76 | 77 | extensions.loadall(self.ui) |
@@ -20,23 +20,22 b' class ui(object):' | |||
|
20 | 20 | self.overlay = config.config() |
|
21 | 21 | self.cdata = config.config() |
|
22 | 22 | self.ucdata = config.config() |
|
23 | self.parentui = None | |
|
24 | 23 | self.trusted_users = {} |
|
25 | 24 | self.trusted_groups = {} |
|
26 | 25 | |
|
27 | 26 | if parentui: |
|
28 |
self. |
|
|
29 |
self.cdata = |
|
|
30 | self.ucdata = self.parentui.ucdata.copy() | |
|
27 | self.cdata = parentui.cdata.copy() | |
|
28 | self.ucdata = parentui.ucdata.copy() | |
|
31 | 29 | self.overlay = parentui.overlay.copy() |
|
32 | 30 | self.trusted_users = parentui.trusted_users.copy() |
|
33 | 31 | self.trusted_groups = parentui.trusted_groups.copy() |
|
34 | self.buffers = parentui.buffers | |
|
35 | 32 | self.fixconfig() |
|
36 | 33 | else: |
|
37 | 34 | # we always trust global config files |
|
38 | 35 | for f in util.rcpath(): |
|
39 | 36 | self.readconfig(f, assumetrusted=True) |
|
37 | def copy(self): | |
|
38 | return ui(self) | |
|
40 | 39 | |
|
41 | 40 | _isatty = None |
|
42 | 41 | def isatty(self): |
@@ -9,8 +9,6 b' from mercurial import commands' | |||
|
9 | 9 | |
|
10 | 10 | def uisetup(ui): |
|
11 | 11 | ui.write("uisetup called\\n") |
|
12 | ui.write("ui.parentui is%s None\\n" % (ui.parentui is not None | |
|
13 | and "not" or "")) | |
|
14 | 12 | |
|
15 | 13 | def reposetup(ui, repo): |
|
16 | 14 | ui.write("reposetup called for %s\\n" % os.path.basename(repo.root)) |
@@ -1,10 +1,8 b'' | |||
|
1 | 1 | uisetup called |
|
2 | ui.parentui isnot None | |
|
3 | 2 | reposetup called for a |
|
4 | 3 | ui == repo.ui |
|
5 | 4 | Foo |
|
6 | 5 | uisetup called |
|
7 | ui.parentui is None | |
|
8 | 6 | reposetup called for a |
|
9 | 7 | ui == repo.ui |
|
10 | 8 | reposetup called for b |
@@ -12,11 +10,9 b' ui == repo.ui' | |||
|
12 | 10 | updating working directory |
|
13 | 11 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
14 | 12 | uisetup called |
|
15 | ui.parentui is None | |
|
16 | 13 | Bar |
|
17 | 14 | % module/__init__.py-style |
|
18 | 15 | uisetup called |
|
19 | ui.parentui isnot None | |
|
20 | 16 | reposetup called for a |
|
21 | 17 | ui == repo.ui |
|
22 | 18 | Foo |
General Comments 0
You need to be logged in to leave comments.
Login now