Mercurial > hgsubversion
comparison hgsubversion/editor.py @ 436:404162e4bb53
editor: move find missing files routine into RevisionData class
author | Dirkjan Ochtman <dirkjan@ochtman.nl> |
---|---|
date | Tue, 16 Jun 2009 09:11:52 +0200 |
parents | 7c576ae19d80 |
children | 0d3b5acb1d51 |
comparison
equal
deleted
inserted
replaced
435:7c576ae19d80 | 436:404162e4bb53 |
---|---|
74 if path in self.files: | 74 if path in self.files: |
75 del self.files[path] | 75 del self.files[path] |
76 self.execfiles[path] = False | 76 self.execfiles[path] = False |
77 self.symlinks[path] = False | 77 self.symlinks[path] = False |
78 self.ui.note('D %s\n' % path) | 78 self.ui.note('D %s\n' % path) |
79 | |
80 def findmissing(self, svn): | |
81 | |
82 if not self.missing: | |
83 return | |
84 | |
85 msg = 'fetching %s files that could not use replay.\n' | |
86 self.ui.debug(msg % len(self.missing)) | |
87 root = svn.subdir and svn.subdir[1:] or '' | |
88 r = self.rev.revnum | |
89 | |
90 files = set() | |
91 for p in self.missing: | |
92 self.ui.note('.') | |
93 self.ui.flush() | |
94 if p[-1] == '/': | |
95 dir = p[len(root):] | |
96 new = [dir + f for f, k in svn.list_files(dir, r) if k == 'f'] | |
97 files.update(new) | |
98 else: | |
99 files.add(p[len(root):]) | |
100 | |
101 i = 1 | |
102 self.ui.note('\nfetching files...\n') | |
103 for p in files: | |
104 self.ui.note('.') | |
105 self.ui.flush() | |
106 if i % 50 == 0: | |
107 svn.init_ra_and_client() | |
108 i += 1 | |
109 data, mode = svn.get_file(p, r) | |
110 self.set(p, data, 'x' in mode, 'l' in mode) | |
111 | |
112 self.missing = set() | |
113 self.ui.note('\n') | |
79 | 114 |
80 | 115 |
81 class HgEditor(delta.Editor): | 116 class HgEditor(delta.Editor): |
82 | 117 |
83 def __init__(self, meta): | 118 def __init__(self, meta): |