Mercurial > hg4j
comparison test/org/tmatesoft/hg/test/StatusOutputParser.java @ 88:61eedab3eb3e
Status between two revisions to recognize copy/rename
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Wed, 26 Jan 2011 05:46:47 +0100 |
parents | e62f9638fb27 |
children | d55d4eedfc57 |
comparison
equal
deleted
inserted
replaced
87:25f2e5d1cd8b | 88:61eedab3eb3e |
---|---|
85 if (copied == null) { | 85 if (copied == null) { |
86 copied = new TreeMap<String, String>(); | 86 copied = new TreeMap<String, String>(); |
87 } | 87 } |
88 // last added is copy destination | 88 // last added is copy destination |
89 // to get or to remove it - depends on what StatusCollector does in this case | 89 // to get or to remove it - depends on what StatusCollector does in this case |
90 copied.put(added.get(added.size() - 1), fname); | 90 copied.put(added.get(added.size() - 1), toJavaImplConvention(fname)); |
91 break; | 91 break; |
92 } | 92 } |
93 } | 93 } |
94 } | 94 } |
95 } | 95 } |
139 | 139 |
140 private List<String> doAdd(List<String> l, String s) { | 140 private List<String> doAdd(List<String> l, String s) { |
141 if (l == null) { | 141 if (l == null) { |
142 l = new LinkedList<String>(); | 142 l = new LinkedList<String>(); |
143 } | 143 } |
144 l.add(toJavaImplConvention(s)); | |
145 return l; | |
146 } | |
147 | |
148 private String toJavaImplConvention(String s) { | |
144 if (winPathSeparator) { | 149 if (winPathSeparator) { |
145 // Java impl always give slashed path, while Hg uses local, os-specific convention | 150 // Java impl always give slashed path, while Hg uses local, os-specific convention |
146 s = s.replace('\\', '/'); | 151 s = s.replace('\\', '/'); |
147 } | 152 } |
148 l.add(s); | 153 return s; |
149 return l; | |
150 } | 154 } |
151 } | 155 } |