# HG changeset patch # User Artem Tikhomirov # Date 1365017286 -7200 # Node ID e6407313bab71a1def058da46bcb3721592cc044 # Parent ca56a36c2eeaee7559680e187e61f1da4dbef7e8 Recognize re: in-line prefix for regular expressions as native client does, despite silence in hgingore.5 diff -r ca56a36c2eea -r e6407313bab7 src/org/tmatesoft/hg/repo/HgIgnore.java --- a/src/org/tmatesoft/hg/repo/HgIgnore.java Thu Feb 28 16:34:33 2013 +0100 +++ b/src/org/tmatesoft/hg/repo/HgIgnore.java Wed Apr 03 21:28:06 2013 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2012 TMate Software Ltd + * Copyright (c) 2010-2013 TMate Software Ltd * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -59,7 +59,7 @@ /* package-local */ List read(BufferedReader content) throws IOException { final String REGEXP = "regexp", GLOB = "glob"; - final String REGEXP_PREFIX = REGEXP + ":", GLOB_PREFIX = GLOB + ":"; + final String REGEXP_PREFIX1 = REGEXP + ":", REGEXP_PREFIX2 = "re:", GLOB_PREFIX = GLOB + ":"; ArrayList errors = new ArrayList(); ArrayList result = new ArrayList(entries); // start with existing String syntax = REGEXP; @@ -94,8 +94,11 @@ if (line.startsWith(GLOB_PREFIX)) { line = line.substring(GLOB_PREFIX.length()).trim(); lineSyntax = GLOB; - } else if (line.startsWith(REGEXP_PREFIX)) { - line = line.substring(REGEXP_PREFIX.length()).trim(); + } else if (line.startsWith(REGEXP_PREFIX1)) { + line = line.substring(REGEXP_PREFIX1.length()).trim(); + lineSyntax = REGEXP; + } else if (line.startsWith(REGEXP_PREFIX2)) { + line = line.substring(REGEXP_PREFIX2.length()).trim(); lineSyntax = REGEXP; } else { lineSyntax = syntax;