Show More
@@ -21,6 +21,11 b' class repocache(filecache):' | |||||
21 | def join(self, obj, fname): |
|
21 | def join(self, obj, fname): | |
22 | return obj._opener.join(fname) |
|
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 | def _finddirs(path): |
|
29 | def _finddirs(path): | |
25 | pos = path.rfind('/') |
|
30 | pos = path.rfind('/') | |
26 | while pos != -1: |
|
31 | while pos != -1: | |
@@ -120,7 +125,7 b' class dirstate(object):' | |||||
120 | def dirs(self): |
|
125 | def dirs(self): | |
121 | return self._dirs |
|
126 | return self._dirs | |
122 |
|
127 | |||
123 | @propertycache |
|
128 | @rootcache('.hgignore') | |
124 | def _ignore(self): |
|
129 | def _ignore(self): | |
125 | files = [self._join('.hgignore')] |
|
130 | files = [self._join('.hgignore')] | |
126 | for name, path in self._ui.configitems("ui"): |
|
131 | for name, path in self._ui.configitems("ui"): |
@@ -219,6 +219,20 b' def branch(server):' | |||||
219 | runcommand(server, ['branch']) |
|
219 | runcommand(server, ['branch']) | |
220 | os.system('hg branch default') |
|
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 | if __name__ == '__main__': |
|
236 | if __name__ == '__main__': | |
223 | os.system('hg init') |
|
237 | os.system('hg init') | |
224 |
|
238 | |||
@@ -240,3 +254,4 b" if __name__ == '__main__':" | |||||
240 | check(setphase) |
|
254 | check(setphase) | |
241 | check(rollback) |
|
255 | check(rollback) | |
242 | check(branch) |
|
256 | check(branch) | |
|
257 | check(hgignore) |
@@ -156,3 +156,10 b' marked working directory as branch foo' | |||||
156 | foo |
|
156 | foo | |
157 | marked working directory as branch default |
|
157 | marked working directory as branch default | |
158 | (branches are permanent and global, did you want a bookmark?) |
|
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