comparison src/org/tmatesoft/hg/core/Cset.java @ 93:d55d4eedfc57

Switch to Path instead of String in filenames returned by various status operations
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 27 Jan 2011 21:15:21 +0100
parents 25f2e5d1cd8b
children af1f3b78b918
comparison
equal deleted inserted replaced
92:bf304cb14247 93:d55d4eedfc57
133 ArrayList<FileRevision> modified = new ArrayList<FileRevision>(); 133 ArrayList<FileRevision> modified = new ArrayList<FileRevision>();
134 ArrayList<FileRevision> added = new ArrayList<FileRevision>(); 134 ArrayList<FileRevision> added = new ArrayList<FileRevision>();
135 StatusCollector.Record r = new StatusCollector.Record(); 135 StatusCollector.Record r = new StatusCollector.Record();
136 statusHelper.change(revNumber, r); 136 statusHelper.change(revNumber, r);
137 final HgRepository repo = statusHelper.getRepo(); 137 final HgRepository repo = statusHelper.getRepo();
138 for (String s : r.getModified()) { 138 for (Path s : r.getModified()) {
139 Path p = pathHelper.path(s);
140 Nodeid nid = r.nodeidAfterChange(s); 139 Nodeid nid = r.nodeidAfterChange(s);
141 if (nid == null) { 140 if (nid == null) {
142 throw new IllegalArgumentException(); 141 throw new IllegalArgumentException();
143 } 142 }
144 modified.add(new FileRevision(repo, nid, p)); 143 modified.add(new FileRevision(repo, nid, s));
145 } 144 }
146 for (String s : r.getAdded()) { 145 for (Path s : r.getAdded()) {
147 Path p = pathHelper.path(s);
148 Nodeid nid = r.nodeidAfterChange(s); 146 Nodeid nid = r.nodeidAfterChange(s);
149 if (nid == null) { 147 if (nid == null) {
150 throw new IllegalArgumentException(); 148 throw new IllegalArgumentException();
151 } 149 }
152 added.add(new FileRevision(repo, nid, p)); 150 added.add(new FileRevision(repo, nid, s));
153 } 151 }
154 for (String s : r.getRemoved()) { 152 for (Path s : r.getRemoved()) {
155 deleted.add(pathHelper.path(s)); 153 deleted.add(s);
156 } 154 }
157 modified.trimToSize(); 155 modified.trimToSize();
158 added.trimToSize(); 156 added.trimToSize();
159 deleted.trimToSize(); 157 deleted.trimToSize();
160 modifiedFiles = Collections.unmodifiableList(modified); 158 modifiedFiles = Collections.unmodifiableList(modified);