Mercurial > hg
comparison hgext/convert/__init__.py @ 5356:f0931c0240b4
convert: add before/after hooks for converter sources
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Tue, 02 Oct 2007 13:46:17 -0700 |
parents | a176f9c8b26e |
children | 6b6104430964 |
comparison
equal
deleted
inserted
replaced
5352:cc34be74eeec | 5356:f0931c0240b4 |
---|---|
233 newnode = self.dest.putcommit(filenames, parents, commit) | 233 newnode = self.dest.putcommit(filenames, parents, commit) |
234 self.mapentry(rev, newnode) | 234 self.mapentry(rev, newnode) |
235 | 235 |
236 def convert(self): | 236 def convert(self): |
237 try: | 237 try: |
238 self.source.before() | |
238 self.dest.before() | 239 self.dest.before() |
239 self.source.setrevmap(self.map) | 240 self.source.setrevmap(self.map) |
240 self.ui.status("scanning source...\n") | 241 self.ui.status("scanning source...\n") |
241 heads = self.source.getheads() | 242 heads = self.source.getheads() |
242 parents = self.walktree(heads) | 243 parents = self.walktree(heads) |
271 self.writeauthormap() | 272 self.writeauthormap() |
272 finally: | 273 finally: |
273 self.cleanup() | 274 self.cleanup() |
274 | 275 |
275 def cleanup(self): | 276 def cleanup(self): |
276 self.dest.after() | 277 try: |
278 self.dest.after() | |
279 finally: | |
280 self.source.after() | |
277 if self.revmapfilefd: | 281 if self.revmapfilefd: |
278 self.revmapfilefd.close() | 282 self.revmapfilefd.close() |
279 | 283 |
280 def rpairs(name): | 284 def rpairs(name): |
281 e = len(name) | 285 e = len(name) |