Mercurial > hg > mercurial-crew-with-dirclash
comparison hgext/convert/subversion.py @ 5382:d7d395fb7cd5
convert_svn: add --filemap support
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Thu, 04 Oct 2007 23:21:37 -0300 |
parents | 6aba1835a7b3 |
children | 1d53a75ea0fc |
comparison
equal
deleted
inserted
replaced
5381:6874368120dc | 5382:d7d395fb7cd5 |
---|---|
144 pass | 144 pass |
145 | 145 |
146 self.last_changed = self.latest(self.module, latest) | 146 self.last_changed = self.latest(self.module, latest) |
147 | 147 |
148 self.head = self.revid(self.last_changed) | 148 self.head = self.revid(self.last_changed) |
149 self._changescache = None | |
149 | 150 |
150 def setrevmap(self, revmap, order): | 151 def setrevmap(self, revmap, order): |
151 lastrevs = {} | 152 lastrevs = {} |
152 for revid in revmap.keys(): | 153 for revid in revmap.keys(): |
153 uuid, module, revnum = self.revsplit(revid) | 154 uuid, module, revnum = self.revsplit(revid) |
204 | 205 |
205 def getmode(self, file, rev): | 206 def getmode(self, file, rev): |
206 return self.modecache[(file, rev)] | 207 return self.modecache[(file, rev)] |
207 | 208 |
208 def getchanges(self, rev): | 209 def getchanges(self, rev): |
210 if self._changescache and self._changescache[0] == rev: | |
211 return self._changescache[1] | |
212 self._changescache = None | |
209 self.modecache = {} | 213 self.modecache = {} |
210 (paths, parents) = self.paths[rev] | 214 (paths, parents) = self.paths[rev] |
211 files, copies = self.expandpaths(rev, paths, parents) | 215 files, copies = self.expandpaths(rev, paths, parents) |
212 files.sort() | 216 files.sort() |
213 files = zip(files, [rev] * len(files)) | 217 files = zip(files, [rev] * len(files)) |
214 | 218 |
215 # caller caches the result, so free it here to release memory | 219 # caller caches the result, so free it here to release memory |
216 del self.paths[rev] | 220 del self.paths[rev] |
217 return (files, copies) | 221 return (files, copies) |
222 | |
223 def getchangedfiles(self, rev, i): | |
224 changes = self.getchanges(rev) | |
225 self._changescache = (rev, changes) | |
226 return [f[0] for f in changes[0]] | |
218 | 227 |
219 def getcommit(self, rev): | 228 def getcommit(self, rev): |
220 if rev not in self.commits: | 229 if rev not in self.commits: |
221 uuid, module, revnum = self.revsplit(rev) | 230 uuid, module, revnum = self.revsplit(rev) |
222 self.module = module | 231 self.module = module |