Mercurial > hg
comparison hgext/convert/__init__.py @ 5121:ef338e34a906
convert: look up copies in getchanges instead of getcommit
svn: defer path expansion until getchanges to reduce latency, as well as memory
usage when converting incrementally.
author | Brendan Cully <brendan@kublai.com> |
---|---|
date | Sun, 05 Aug 2007 12:03:27 -0700 |
parents | c7623d2b2a66 |
children | 39b6eaee6fd7 |
comparison
equal
deleted
inserted
replaced
5120:514c06098e9c | 5121:ef338e34a906 |
---|---|
191 def copy(self, rev): | 191 def copy(self, rev): |
192 commit = self.commitcache[rev] | 192 commit = self.commitcache[rev] |
193 do_copies = hasattr(self.dest, 'copyfile') | 193 do_copies = hasattr(self.dest, 'copyfile') |
194 filenames = [] | 194 filenames = [] |
195 | 195 |
196 for f, v in self.source.getchanges(rev): | 196 files, copies = self.source.getchanges(rev) |
197 for f, v in files: | |
197 newf = self.mapfile(f) | 198 newf = self.mapfile(f) |
198 if not newf: | 199 if not newf: |
199 continue | 200 continue |
200 filenames.append(newf) | 201 filenames.append(newf) |
201 try: | 202 try: |
204 self.dest.delfile(newf) | 205 self.dest.delfile(newf) |
205 else: | 206 else: |
206 e = self.source.getmode(f, v) | 207 e = self.source.getmode(f, v) |
207 self.dest.putfile(newf, e, data) | 208 self.dest.putfile(newf, e, data) |
208 if do_copies: | 209 if do_copies: |
209 if f in commit.copies: | 210 if f in copies: |
210 copyf = self.mapfile(commit.copies[f]) | 211 copyf = self.mapfile(copies[f]) |
211 if copyf: | 212 if copyf: |
212 # Merely marks that a copy happened. | 213 # Merely marks that a copy happened. |
213 self.dest.copyfile(copyf, newf) | 214 self.dest.copyfile(copyf, newf) |
214 | 215 |
215 parents = [self.map[r] for r in commit.parents] | 216 parents = [self.map[r] for r in commit.parents] |