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

hg2git: move parse_subrepos to top level

durin42 expressed a desire for this function to be at the top level.
parent ab3c64db
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,16 @@
import util
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
class IncrementalChangesetExporter(object):
"""Incrementally export Mercurial changesets to Git trees.
......@@ -269,16 +279,6 @@
parent_tree[os.path.basename(d)] = (stat.S_IFDIR, tree.id)
def _handle_subrepos(self, newctx, dirty_trees):
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
sub, substate = parse_subrepos(self._ctx)
newsub, newsubstate = parse_subrepos(newctx)
......
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