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

hg2git: factor out subrepo parsing into a separate function

This code will be used in multiple contexts in an upcoming patch.
parent 104f536b
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,6 @@
import util
class IncrementalChangesetExporter(object):
"""Incrementally export Mercurial changesets to Git trees.
......@@ -263,6 +262,13 @@
parent_tree[os.path.basename(d)] = (stat.S_IFDIR, tree.id)
def _handle_subrepos(self, ctx, dirty_trees):
substate = util.parse_hgsubstate(ctx['.hgsubstate'].data().splitlines())
sub = util.OrderedDict()
def parse_subrepos(ctx):
sub = util.OrderedDict()
if '.hgsub' in ctx:
sub = util.parse_hgsub(ctx['.hgsub'].data().splitlines())
substate = util.OrderedDict()
if '.hgsubstate' in ctx:
substate = util.parse_hgsubstate(
ctx['.hgsubstate'].data().splitlines())
return sub, substate
......@@ -268,6 +274,5 @@
if '.hgsub' in ctx:
sub = util.parse_hgsub(ctx['.hgsub'].data().splitlines())
sub, substate = parse_subrepos(ctx)
for path, sha in substate.iteritems():
# Ignore non-Git repositories keeping state in .hgsubstate.
......
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