Mercurial > hgsubversion
comparison svnwrap/svn_swig_wrapper.py @ 215:b5ef9a404f5d
Stopped idiotic filtering of revisions that did not edit something branches/tags/trunk.
Fixed a bunch of tests as a result. This likely will make new conversions of some repos have new revisions in them.
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Fri, 27 Mar 2009 16:56:07 -0500 |
parents | 77812f98e250 |
children | f71af18c4379 |
comparison
equal
deleted
inserted
replaced
214:1416429584b2 | 215:b5ef9a404f5d |
---|---|
209 if hist.paths[path].copyfrom_path is None: | 209 if hist.paths[path].copyfrom_path is None: |
210 return None, None | 210 return None, None |
211 source = hist.paths[path].copyfrom_path | 211 source = hist.paths[path].copyfrom_path |
212 source_rev = 0 | 212 source_rev = 0 |
213 for p in hist.paths: | 213 for p in hist.paths: |
214 if not p.startswith(path): | |
215 continue | |
214 if hist.paths[p].copyfrom_rev: | 216 if hist.paths[p].copyfrom_rev: |
215 # We assume that the revision of the source tree as it was | 217 # We assume that the revision of the source tree as it was |
216 # copied was actually the revision of the highest revision | 218 # copied was actually the revision of the highest revision |
217 # copied item. This could be wrong, but in practice it will | 219 # copied item. This could be wrong, but in practice it will |
218 # *probably* be correct | 220 # *probably* be correct |
245 of revisions at a time. | 247 of revisions at a time. |
246 | 248 |
247 The reason this is lazy is so that you can use the same repo object | 249 The reason this is lazy is so that you can use the same repo object |
248 to perform RA calls to get deltas. | 250 to perform RA calls to get deltas. |
249 """ | 251 """ |
250 # NB: you'd think this would work, but you'd be wrong. I'm pretty | 252 return self.fetch_history_at_paths([''], start=start, |
251 # convinced there must be some kind of svn bug here. | 253 chunk_size=chunk_size) |
252 #return self.fetch_history_at_paths(['tags', 'trunk', 'branches'], | |
253 # start=start) | |
254 # this does the same thing, but at the repo root + filtering. It's | |
255 # kind of tough cookies, sadly. | |
256 for r in self.fetch_history_at_paths([''], start=start, | |
257 chunk_size=chunk_size): | |
258 should_yield = False | |
259 i = 0 | |
260 paths = list(r.paths.keys()) | |
261 while i < len(paths) and not should_yield: | |
262 p = paths[i] | |
263 if (p.startswith('trunk') or p.startswith('tags') | |
264 or p.startswith('branches')): | |
265 should_yield = True | |
266 i += 1 | |
267 if should_yield: | |
268 yield r | |
269 | |
270 | 254 |
271 def fetch_history_at_paths(self, paths, start=None, stop=None, | 255 def fetch_history_at_paths(self, paths, start=None, stop=None, |
272 chunk_size=1000): | 256 chunk_size=1000): |
273 revisions = [] | 257 revisions = [] |
274 def callback(paths, revnum, author, date, message, pool): | 258 def callback(paths, revnum, author, date, message, pool): |