##// END OF EJS Templates
mq: only read files when needed...
Simon Heimberg -
r8524:21c87b29 default
parent child Browse files
Show More
@@ -123,8 +123,6 b' class queue:'
123 123 self.path = patchdir or os.path.join(path, "patches")
124 124 self.opener = util.opener(self.path)
125 125 self.ui = ui
126 self.applied = []
127 self.full_series = []
128 126 self.applied_dirty = 0
129 127 self.series_dirty = 0
130 128 self.series_path = "series"
@@ -134,13 +132,28 b' class queue:'
134 132 self.guards_dirty = False
135 133 self._diffopts = None
136 134
137 if os.path.exists(self.join(self.series_path)):
138 self.full_series = self.opener(self.series_path).read().splitlines()
139 self.parse_series()
140
135 @util.propertycache
136 def applied(self):
141 137 if os.path.exists(self.join(self.status_path)):
142 138 lines = self.opener(self.status_path).read().splitlines()
143 self.applied = [statusentry(l) for l in lines]
139 return [statusentry(l) for l in lines]
140 return []
141
142 @util.propertycache
143 def full_series(self):
144 if os.path.exists(self.join(self.series_path)):
145 return self.opener(self.series_path).read().splitlines()
146 return []
147
148 @util.propertycache
149 def series(self):
150 self.parse_series()
151 return self.series
152
153 @util.propertycache
154 def series_guards(self):
155 self.parse_series()
156 return self.series_guards
144 157
145 158 def diffopts(self):
146 159 if self._diffopts is None:
@@ -2386,6 +2399,10 b' def finish(ui, repo, *revrange, **opts):'
2386 2399
2387 2400 def reposetup(ui, repo):
2388 2401 class mqrepo(repo.__class__):
2402 @util.propertycache
2403 def mq(self):
2404 return queue(self.ui, self.join(""))
2405
2389 2406 def abort_if_wdir_patched(self, errmsg, force=False):
2390 2407 if self.mq.applied and not force:
2391 2408 parent = hex(self.dirstate.parents()[0])
@@ -2467,7 +2484,6 b' def reposetup(ui, repo):'
2467 2484
2468 2485 if repo.local():
2469 2486 repo.__class__ = mqrepo
2470 repo.mq = queue(ui, repo.join(""))
2471 2487
2472 2488 def mqimport(orig, ui, repo, *args, **kwargs):
2473 2489 if hasattr(repo, 'abort_if_wdir_patched'):
General Comments 0
You need to be logged in to leave comments. Login now