Skip to content
Snippets Groups Projects
Commit 3c32a3fd authored by Yuya Nishihara's avatar Yuya Nishihara
Browse files

fileset: extract function that builds initial subset from ctx or status

This function will be used to recalculate subset when mctx.ctx is switched.
parent ec5b56b5
No related branches found
No related tags found
No related merge requests found
......@@ -514,6 +514,15 @@
return True
return False
def _buildsubset(ctx, status):
if status:
subset = []
for c in status:
subset.extend(c)
return subset
else:
return list(ctx.walk(ctx.match([])))
def getfileset(ctx, expr):
tree = parse(expr)
......@@ -528,8 +537,5 @@
r = ctx.repo()
status = r.status(ctx.p1(), ctx,
unknown=unknown, ignored=ignored, clean=True)
subset = []
for c in status:
subset.extend(c)
else:
status = None
......@@ -534,4 +540,3 @@
else:
status = None
subset = list(ctx.walk(ctx.match([])))
......@@ -537,4 +542,5 @@
subset = _buildsubset(ctx, status)
return getset(fullmatchctx(ctx, subset, status), tree)
def prettyformat(tree):
......
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