Skip to content
Snippets Groups Projects
Commit d0ce6eae authored by Ryan McElroy's avatar Ryan McElroy
Browse files

githandler: respect mapsavefrequency during export

When importing changesets, hggit uses the config knob hggit.mapsavefrequency to
determine how often to save the mapfile. This allows a user to interrupt the
import without losing all progress.

This patch adds this same functionality to the export mechanism.
parent a128b9a5
No related branches found
No related tags found
No related merge requests found
......@@ -459,6 +459,7 @@
exporter = hg2git.IncrementalChangesetExporter(
self.repo, pctx, self.git.object_store, gitcommit)
mapsavefreq = self.ui.configint('hggit', 'mapsavefrequency', 0)
for i, ctx in enumerate(export):
self.ui.progress('exporting', i, total=total)
self.export_hg_commit(ctx.node(), exporter)
......@@ -462,6 +463,9 @@
for i, ctx in enumerate(export):
self.ui.progress('exporting', i, total=total)
self.export_hg_commit(ctx.node(), exporter)
if mapsavefreq and i % mapsavefreq == 0:
self.ui.debug(_("saving mapfile\n"))
self.save_map(self.map_file)
self.ui.progress('exporting', None, total=total)
def set_commiter_from_author(self, commit):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment