##// 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 self.path = patchdir or os.path.join(path, "patches")
123 self.path = patchdir or os.path.join(path, "patches")
124 self.opener = util.opener(self.path)
124 self.opener = util.opener(self.path)
125 self.ui = ui
125 self.ui = ui
126 self.applied = []
127 self.full_series = []
128 self.applied_dirty = 0
126 self.applied_dirty = 0
129 self.series_dirty = 0
127 self.series_dirty = 0
130 self.series_path = "series"
128 self.series_path = "series"
@@ -134,13 +132,28 b' class queue:'
134 self.guards_dirty = False
132 self.guards_dirty = False
135 self._diffopts = None
133 self._diffopts = None
136
134
137 if os.path.exists(self.join(self.series_path)):
135 @util.propertycache
138 self.full_series = self.opener(self.series_path).read().splitlines()
136 def applied(self):
139 self.parse_series()
140
141 if os.path.exists(self.join(self.status_path)):
137 if os.path.exists(self.join(self.status_path)):
142 lines = self.opener(self.status_path).read().splitlines()
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 def diffopts(self):
158 def diffopts(self):
146 if self._diffopts is None:
159 if self._diffopts is None:
@@ -2386,6 +2399,10 b' def finish(ui, repo, *revrange, **opts):'
2386
2399
2387 def reposetup(ui, repo):
2400 def reposetup(ui, repo):
2388 class mqrepo(repo.__class__):
2401 class mqrepo(repo.__class__):
2402 @util.propertycache
2403 def mq(self):
2404 return queue(self.ui, self.join(""))
2405
2389 def abort_if_wdir_patched(self, errmsg, force=False):
2406 def abort_if_wdir_patched(self, errmsg, force=False):
2390 if self.mq.applied and not force:
2407 if self.mq.applied and not force:
2391 parent = hex(self.dirstate.parents()[0])
2408 parent = hex(self.dirstate.parents()[0])
@@ -2467,7 +2484,6 b' def reposetup(ui, repo):'
2467
2484
2468 if repo.local():
2485 if repo.local():
2469 repo.__class__ = mqrepo
2486 repo.__class__ = mqrepo
2470 repo.mq = queue(ui, repo.join(""))
2471
2487
2472 def mqimport(orig, ui, repo, *args, **kwargs):
2488 def mqimport(orig, ui, repo, *args, **kwargs):
2473 if hasattr(repo, 'abort_if_wdir_patched'):
2489 if hasattr(repo, 'abort_if_wdir_patched'):
General Comments 0
You need to be logged in to leave comments. Login now