Mercurial > hg-stable
comparison mercurial/localrepo.py @ 1102:c81d264cd17d
localrepo: minor opener usage restructuring
author | mpm@selenic.com |
---|---|
date | Sat, 27 Aug 2005 16:34:54 -0700 |
parents | mercurial/hg.py@2cf5c8a4eae5 mercurial/hg.py@2cf5c8a4eae5 |
children | 30ab5b8ee8ec |
comparison
equal
deleted
inserted
replaced
1101:2cf5c8a4eae5 | 1102:c81d264cd17d |
---|---|
10 from node import * | 10 from node import * |
11 from demandload import * | 11 from demandload import * |
12 demandload(globals(), "re lock transaction tempfile stat mdiff") | 12 demandload(globals(), "re lock transaction tempfile stat mdiff") |
13 | 13 |
14 class localrepository: | 14 class localrepository: |
15 def __init__(self, ui, opener, path=None, create=0): | 15 def __init__(self, ui, path=None, create=0): |
16 if not path: | 16 if not path: |
17 p = os.getcwd() | 17 p = os.getcwd() |
18 while not os.path.isdir(os.path.join(p, ".hg")): | 18 while not os.path.isdir(os.path.join(p, ".hg")): |
19 oldp = p | 19 oldp = p |
20 p = os.path.dirname(p) | 20 p = os.path.dirname(p) |
30 | 30 |
31 if create: | 31 if create: |
32 os.mkdir(self.path) | 32 os.mkdir(self.path) |
33 os.mkdir(self.join("data")) | 33 os.mkdir(self.join("data")) |
34 | 34 |
35 self.opener = opener(self.path) | 35 self.opener = util.opener(self.path) |
36 self.wopener = opener(self.root) | 36 self.wopener = util.opener(self.root) |
37 self.manifest = manifest.manifest(self.opener) | 37 self.manifest = manifest.manifest(self.opener) |
38 self.changelog = changelog.changelog(self.opener) | 38 self.changelog = changelog.changelog(self.opener) |
39 self.tagscache = None | 39 self.tagscache = None |
40 self.nodetagscache = None | 40 self.nodetagscache = None |
41 | 41 |