Show More
@@ -21,6 +21,11 b' class repocache(filecache):' | |||
|
21 | 21 | def join(self, obj, fname): |
|
22 | 22 | return obj._opener.join(fname) |
|
23 | 23 | |
|
24 | class rootcache(filecache): | |
|
25 | """filecache for files in the repository root""" | |
|
26 | def join(self, obj, fname): | |
|
27 | return obj._join(fname) | |
|
28 | ||
|
24 | 29 | def _finddirs(path): |
|
25 | 30 | pos = path.rfind('/') |
|
26 | 31 | while pos != -1: |
@@ -120,7 +125,7 b' class dirstate(object):' | |||
|
120 | 125 | def dirs(self): |
|
121 | 126 | return self._dirs |
|
122 | 127 | |
|
123 | @propertycache | |
|
128 | @rootcache('.hgignore') | |
|
124 | 129 | def _ignore(self): |
|
125 | 130 | files = [self._join('.hgignore')] |
|
126 | 131 | for name, path in self._ui.configitems("ui"): |
@@ -219,6 +219,20 b' def branch(server):' | |||
|
219 | 219 | runcommand(server, ['branch']) |
|
220 | 220 | os.system('hg branch default') |
|
221 | 221 | |
|
222 | def hgignore(server): | |
|
223 | readchannel(server) | |
|
224 | f = open('.hgignore', 'ab') | |
|
225 | f.write('') | |
|
226 | f.close() | |
|
227 | runcommand(server, ['commit', '-Am.']) | |
|
228 | f = open('ignored-file', 'ab') | |
|
229 | f.write('') | |
|
230 | f.close() | |
|
231 | f = open('.hgignore', 'ab') | |
|
232 | f.write('ignored-file') | |
|
233 | f.close() | |
|
234 | runcommand(server, ['status', '-i', '-u']) | |
|
235 | ||
|
222 | 236 | if __name__ == '__main__': |
|
223 | 237 | os.system('hg init') |
|
224 | 238 | |
@@ -240,3 +254,4 b" if __name__ == '__main__':" | |||
|
240 | 254 | check(setphase) |
|
241 | 255 | check(rollback) |
|
242 | 256 | check(branch) |
|
257 | check(hgignore) |
@@ -156,3 +156,10 b' marked working directory as branch foo' | |||
|
156 | 156 | foo |
|
157 | 157 | marked working directory as branch default |
|
158 | 158 | (branches are permanent and global, did you want a bookmark?) |
|
159 | ||
|
160 | testing hgignore: | |
|
161 | ||
|
162 | runcommand commit -Am. | |
|
163 | adding .hgignore | |
|
164 | runcommand status -i -u | |
|
165 | I ignored-file |
General Comments 0
You need to be logged in to leave comments.
Login now