48 if err.errno != errno.ENOENT: raise |
48 if err.errno != errno.ENOENT: raise |
49 return self._pl |
49 return self._pl |
50 elif name == '_dirs': |
50 elif name == '_dirs': |
51 self._dirs = {} |
51 self._dirs = {} |
52 for f in self._map: |
52 for f in self._map: |
53 self._incpath(f) |
53 if self[f] != 'r': |
|
54 self._incpath(f) |
54 return self._dirs |
55 return self._dirs |
55 elif name == '_ignore': |
56 elif name == '_ignore': |
56 files = [self._join('.hgignore')] |
57 files = [self._join('.hgignore')] |
57 for name, path in self._ui.configitems("ui"): |
58 for name, path in self._ui.configitems("ui"): |
58 if name == 'ignore' or name.startswith('ignore.'): |
59 if name == 'ignore' or name.startswith('ignore.'): |
203 raise util.Abort(_('directory %r already in dirstate') % f) |
204 raise util.Abort(_('directory %r already in dirstate') % f) |
204 for c in strutil.rfindall(f, '/'): |
205 for c in strutil.rfindall(f, '/'): |
205 d = f[:c] |
206 d = f[:c] |
206 if d in self._dirs: |
207 if d in self._dirs: |
207 break |
208 break |
208 if d in self._map: |
209 if d in self._map and self[d] != 'r': |
209 raise util.Abort(_('file %r in dirstate clashes with %r') % |
210 raise util.Abort(_('file %r in dirstate clashes with %r') % |
210 (d, f)) |
211 (d, f)) |
211 self._incpath(f) |
212 self._incpath(f) |
212 |
213 |
213 def normal(self, f): |
214 def normal(self, f): |
214 'mark a file normal and clean' |
215 'mark a file normal and clean' |
215 self._dirty = True |
216 self._dirty = True |
|
217 if self[f] == 'r': |
|
218 self._incpathcheck(f) |
216 s = os.lstat(self._join(f)) |
219 s = os.lstat(self._join(f)) |
217 self._map[f] = ('n', s.st_mode, s.st_size, s.st_mtime, 0) |
220 self._map[f] = ('n', s.st_mode, s.st_size, s.st_mtime, 0) |
218 if self._copymap.has_key(f): |
221 if self._copymap.has_key(f): |
219 del self._copymap[f] |
222 del self._copymap[f] |
220 |
223 |
221 def normallookup(self, f): |
224 def normallookup(self, f): |
222 'mark a file normal, but possibly dirty' |
225 'mark a file normal, but possibly dirty' |
223 self._dirty = True |
226 self._dirty = True |
|
227 if self[f] == 'r': |
|
228 self._incpathcheck(f) |
224 self._map[f] = ('n', 0, -1, -1, 0) |
229 self._map[f] = ('n', 0, -1, -1, 0) |
225 if f in self._copymap: |
230 if f in self._copymap: |
226 del self._copymap[f] |
231 del self._copymap[f] |
227 |
232 |
228 def normaldirty(self, f): |
233 def normaldirty(self, f): |
229 'mark a file normal, but dirty' |
234 'mark a file normal, but dirty' |
230 self._dirty = True |
235 self._dirty = True |
|
236 if self[f] == 'r': |
|
237 self._incpathcheck(f) |
231 self._map[f] = ('n', 0, -2, -1, 0) |
238 self._map[f] = ('n', 0, -2, -1, 0) |
232 if f in self._copymap: |
239 if f in self._copymap: |
233 del self._copymap[f] |
240 del self._copymap[f] |
234 |
241 |
235 def add(self, f): |
242 def add(self, f): |
520 nonexistent = True |
528 nonexistent = True |
521 if not st: |
529 if not st: |
522 try: |
530 try: |
523 st = lstat(_join(fn)) |
531 st = lstat(_join(fn)) |
524 except OSError, inst: |
532 except OSError, inst: |
525 if inst.errno != errno.ENOENT: |
533 if inst.errno not in (errno.ENOENT, errno.ENOTDIR): |
526 raise |
534 raise |
527 st = None |
535 st = None |
528 # We need to re-check that it is a valid file |
536 # We need to re-check that it is a valid file |
529 if st and self._supported(fn, st.st_mode): |
537 if st and self._supported(fn, st.st_mode): |
530 nonexistent = False |
538 nonexistent = False |