Mercurial > hg > mercurial-crew-with-dirclash
comparison mercurial/dirstate.py @ 2004:7dd6317ab4fd
Add warning if user-configured hgignore file isn't found
author | mcmillen@cs.cmu.edu |
---|---|
date | Sat, 25 Mar 2006 10:02:39 +0100 |
parents | 62647394e368 |
children | bc47af2d3693 |
comparison
equal
deleted
inserted
replaced
2003:62647394e368 | 2004:7dd6317ab4fd |
---|---|
60 if escape: escape = False | 60 if escape: escape = False |
61 elif line[i] == '\\': escape = True | 61 elif line[i] == '\\': escape = True |
62 elif line[i] == '#': break | 62 elif line[i] == '#': break |
63 line = line[:i].rstrip() | 63 line = line[:i].rstrip() |
64 if line: yield line | 64 if line: yield line |
65 files = [self.wjoin('.hgignore')] | 65 repoignore = self.wjoin('.hgignore') |
66 files = [repoignore] | |
66 files.extend(self.ui.hgignorefiles()) | 67 files.extend(self.ui.hgignorefiles()) |
67 pats = [] | 68 pats = [] |
68 for f in files: | 69 for f in files: |
69 try: | 70 try: |
70 fp = open(f) | 71 fp = open(f) |
82 for s in syntaxes.values(): | 83 for s in syntaxes.values(): |
83 if line.startswith(s): | 84 if line.startswith(s): |
84 pat = line | 85 pat = line |
85 break | 86 break |
86 pats.append(pat) | 87 pats.append(pat) |
87 except IOError: pass | 88 except IOError: |
89 if f != repoignore: | |
90 self.ui.warn(_("ignore file %s not found\n") % f) | |
88 return pats | 91 return pats |
89 | 92 |
90 def ignore(self, fn): | 93 def ignore(self, fn): |
91 '''default match function used by dirstate and | 94 '''default match function used by dirstate and |
92 localrepository. this honours the repository .hgignore file | 95 localrepository. this honours the repository .hgignore file |