Skip to content
Snippets Groups Projects
Commit 4b5a18d2 authored by Siddharth Agarwal's avatar Siddharth Agarwal
Browse files

git_handler.export_git_objects: filter out octopus explosions earlier

hg-git translates octopus merges into a series of merges, called an octopus
explosion. The intermediate octopus explosion commits are not recorded in
the mapfile -- only the final commit is. This means that they show up in the
export list and have to then be detected and filtered out.

Don't initialize the incremental exporter with octopus explosion commits.
Previously, if there were octopus merges early in the history, we'd initialize
the incremental exporter with the first one's parent, then calculate the diff
of that against the first commit we actually cared about exporting. That's slow
and wasteful.

For a particular real-world repo with one octopus merge 1/3 of the way in
history, this is a 10x improvement for 'hg gexport' with one commit to export
-- 60 seconds to 6.
parent 5fa9649c
No related branches found
No related tags found
No related merge requests found
......@@ -380,6 +380,8 @@
clnode = repo.changelog.node
nodes = [clnode(n) for n in repo]
export = [repo[node] for node in nodes if not hex(node) in self._map_hg]
export = [ctx for ctx in export
if ctx.extra().get('hg-git', None) != 'octopus']
total = len(export)
if not total:
return
......@@ -410,10 +412,6 @@
for i, ctx in enumerate(export):
self.ui.progress('exporting', i, total=total)
state = ctx.extra().get('hg-git', None)
if state == 'octopus':
self.ui.debug("revision %d is a part "
"of octopus explosion\n" % ctx.rev())
continue
self.export_hg_commit(ctx.node(), exporter)
self.ui.progress('exporting', None, total=total)
......
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