Mercurial > hg4j
comparison test/org/tmatesoft/hg/test/StatusOutputParser.java @ 94:af1f3b78b918
*StatusCollector renamed to Hg*StatusCollector
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Thu, 27 Jan 2011 21:18:47 +0100 |
parents | d55d4eedfc57 |
children | a3a2e5deb320 |
comparison
equal
deleted
inserted
replaced
93:d55d4eedfc57 | 94:af1f3b78b918 |
---|---|
22 import java.util.Map; | 22 import java.util.Map; |
23 import java.util.regex.Matcher; | 23 import java.util.regex.Matcher; |
24 import java.util.regex.Pattern; | 24 import java.util.regex.Pattern; |
25 | 25 |
26 import org.tmatesoft.hg.core.Path; | 26 import org.tmatesoft.hg.core.Path; |
27 import org.tmatesoft.hg.repo.StatusCollector; | 27 import org.tmatesoft.hg.repo.HgStatusCollector; |
28 import org.tmatesoft.hg.util.PathPool; | 28 import org.tmatesoft.hg.util.PathPool; |
29 import org.tmatesoft.hg.util.PathRewrite; | 29 import org.tmatesoft.hg.util.PathRewrite; |
30 | 30 |
31 /** | 31 /** |
32 * | 32 * |
36 public class StatusOutputParser implements OutputParser { | 36 public class StatusOutputParser implements OutputParser { |
37 | 37 |
38 private final Pattern pattern; | 38 private final Pattern pattern; |
39 // although using StatusCollector.Record is not really quite honest for testing, | 39 // although using StatusCollector.Record is not really quite honest for testing, |
40 // it's deemed acceptable as long as that class is primitive 'collect all results' | 40 // it's deemed acceptable as long as that class is primitive 'collect all results' |
41 private StatusCollector.Record result = new StatusCollector.Record(); | 41 private HgStatusCollector.Record result = new HgStatusCollector.Record(); |
42 private final PathPool pathHelper; | 42 private final PathPool pathHelper; |
43 | 43 |
44 public StatusOutputParser() { | 44 public StatusOutputParser() { |
45 // pattern = Pattern.compile("^([MAR?IC! ]) ([\\w \\.-/\\\\]+)$", Pattern.MULTILINE); | 45 // pattern = Pattern.compile("^([MAR?IC! ]) ([\\w \\.-/\\\\]+)$", Pattern.MULTILINE); |
46 pattern = Pattern.compile("^([MAR?IC! ]) (.+)$", Pattern.MULTILINE); | 46 pattern = Pattern.compile("^([MAR?IC! ]) (.+)$", Pattern.MULTILINE); |
57 } | 57 } |
58 }); | 58 }); |
59 } | 59 } |
60 | 60 |
61 public void reset() { | 61 public void reset() { |
62 result = new StatusCollector.Record(); | 62 result = new HgStatusCollector.Record(); |
63 } | 63 } |
64 | 64 |
65 public void parse(CharSequence seq) { | 65 public void parse(CharSequence seq) { |
66 Matcher m = pattern.matcher(seq); | 66 Matcher m = pattern.matcher(seq); |
67 Path lastAdded = null; | 67 Path lastAdded = null; |