Mercurial > jhg
comparison src/org/tmatesoft/hg/repo/HgRepository.java @ 335:3d41dc148d14
Do not fail with exception on syntax errors in .hgignore
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Thu, 10 Nov 2011 05:44:12 +0100 |
parents | a37ce7145c3f |
children | f377f833b780 |
comparison
equal
deleted
inserted
replaced
334:15e1961719f2 | 335:3d41dc148d14 |
---|---|
321 | 321 |
322 /** | 322 /** |
323 * Access to configured set of ignored files. | 323 * Access to configured set of ignored files. |
324 * @see HgIgnore#isIgnored(Path) | 324 * @see HgIgnore#isIgnored(Path) |
325 */ | 325 */ |
326 public HgIgnore getIgnore() { | 326 public HgIgnore getIgnore() /*throws HgInvalidControlFileException */{ |
327 // TODO read config for additional locations | 327 // TODO read config for additional locations |
328 if (ignore == null) { | 328 if (ignore == null) { |
329 ignore = new HgIgnore(); | 329 ignore = new HgIgnore(); |
330 File ignoreFile = new File(getWorkingDir(), ".hgignore"); | |
330 try { | 331 try { |
331 File ignoreFile = new File(getWorkingDir(), ".hgignore"); | 332 final List<String> errors = ignore.read(ignoreFile); |
332 ignore.read(ignoreFile); | 333 if (errors != null) { |
334 getContext().getLog().warn(getClass(), "Syntax errors parsing .hgignore:\n%s", errors); | |
335 } | |
333 } catch (IOException ex) { | 336 } catch (IOException ex) { |
334 getContext().getLog().warn(getClass(), ex, null); | 337 final String m = "Error reading .hgignore file"; |
338 getContext().getLog().warn(getClass(), ex, m); | |
339 // throw new HgInvalidControlFileException(m, ex, ignoreFile); | |
335 } | 340 } |
336 } | 341 } |
337 return ignore; | 342 return ignore; |
338 } | 343 } |
339 | 344 |