| 79 | | history = [] |
| 80 | | if hasattr(repos, 'svn_repos_history2'): |
| 81 | | # For Subversion >= 1.1 |
| 82 | | def authz_cb(root, path, pool): |
| 83 | | if limit and len(history) >= limit: |
| 84 | | return 0 |
| 85 | | return authz.has_permission(_from_svn(path)) and 1 or 0 |
| 86 | | def history2_cb(path, rev, pool): |
| 87 | | history.append((_from_svn(path), rev)) |
| 88 | | repos.svn_repos_history2(fs_ptr, svn_path, history2_cb, authz_cb, |
| 89 | | start, end, 1, pool()) |
| 90 | | else: |
| 91 | | # For Subversion 1.0.x |
| 92 | | def history_cb(path, rev, pool): |
| 93 | | path = _from_svn(path) |
| 94 | | if authz.has_permission(path): |
| 95 | | history.append((path, rev)) |
| 96 | | repos.svn_repos_history(fs_ptr, svn_path, history_cb, |
| 97 | | start, end, 1, pool()) |
| 98 | | for item in history: |
| 99 | | yield item |
| | 79 | cur_end = end |
| | 80 | |
| | 81 | while start <= cur_end: |
| | 82 | history = [] |
| | 84 | cur_start = cur_end - 50 |
| | 85 | if cur_start < start: |
| | 86 | cur_start = start |
| | 87 | |
| | 88 | try: |
| | 89 | if hasattr(repos, 'svn_repos_history2'): |
| | 90 | # For Subversion >= 1.1 |
| | 91 | def authz_cb(root, path, pool): |
| | 92 | if limit and len(history) >= limit: |
| | 93 | return 0 |
| | 94 | return authz.has_permission(_from_svn(path)) and 1 or 0 |
| | 95 | def history2_cb(path, rev, pool): |
| | 96 | history.append((_from_svn(path), rev)) |
| | 97 | repos.svn_repos_history2(fs_ptr, svn_path, history2_cb, authz_cb, |
| | 98 | cur_start, cur_end, 1, pool()) |
| | 99 | else: |
| | 100 | # For Subversion 1.0.x |
| | 101 | def history_cb(path, rev, pool): |
| | 102 | path = _from_svn(path) |
| | 103 | if authz.has_permission(path): |
| | 104 | history.append((path, rev)) |
| | 105 | |
| | 106 | repos.svn_repos_history(fs_ptr, svn_path, history_cb, |
| | 107 | cur_start, cur_end, 1, pool()) |
| | 108 | except (core.SubversionException): |
| | 109 | pass |
| | 110 | |
| | 111 | cur_end = cur_start - 1 |
| | 112 | |
| | 113 | for item in history: |
| | 114 | yield item |
| | 115 | |