Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHGf92844cb942c: subrepo: adjust subrepo prefix before calling subrepo.forget() (API)
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/cmdutil.py (5 lines) | |||
M | mercurial/subrepo.py (3 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
Martin von Zweigbergk | Feb 7 2019, 12:52 PM |
Status | Author | Revision | |
---|---|---|---|
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz |
s = repo.status(match=matchmod.badmatch(match, badfn), clean=True) | s = repo.status(match=matchmod.badmatch(match, badfn), clean=True) | ||||
forget = sorted(s.modified + s.added + s.deleted + s.clean) | forget = sorted(s.modified + s.added + s.deleted + s.clean) | ||||
if explicitonly: | if explicitonly: | ||||
forget = [f for f in forget if match.exact(f)] | forget = [f for f in forget if match.exact(f)] | ||||
for subpath in sorted(wctx.substate): | for subpath in sorted(wctx.substate): | ||||
sub = wctx.sub(subpath) | sub = wctx.sub(subpath) | ||||
try: | |||||
submatch = matchmod.subdirmatcher(subpath, match) | submatch = matchmod.subdirmatcher(subpath, match) | ||||
subbad, subforgot = sub.forget(submatch, prefix, dryrun=dryrun, | subprefix = repo.wvfs.reljoin(prefix, subpath) | ||||
try: | |||||
subbad, subforgot = sub.forget(submatch, subprefix, dryrun=dryrun, | |||||
interactive=interactive) | interactive=interactive) | ||||
bad.extend([subpath + '/' + f for f in subbad]) | bad.extend([subpath + '/' + f for f in subbad]) | ||||
forgot.extend([subpath + '/' + f for f in subforgot]) | forgot.extend([subpath + '/' + f for f in subforgot]) | ||||
except error.LookupError: | except error.LookupError: | ||||
ui.status(_("skipping missing subrepository: %s\n") | ui.status(_("skipping missing subrepository: %s\n") | ||||
% join(subpath)) | % join(subpath)) | ||||
if not explicitonly: | if not explicitonly: |
return matchmod.unionmatcher(matchers) | return matchmod.unionmatcher(matchers) | ||||
def walk(self, match): | def walk(self, match): | ||||
ctx = self._repo[None] | ctx = self._repo[None] | ||||
return ctx.walk(match) | return ctx.walk(match) | ||||
@annotatesubrepoerror | @annotatesubrepoerror | ||||
def forget(self, match, prefix, dryrun, interactive): | def forget(self, match, prefix, dryrun, interactive): | ||||
return cmdutil.forget(self.ui, self._repo, match, | return cmdutil.forget(self.ui, self._repo, match, prefix, | ||||
self.wvfs.reljoin(prefix, self._path), | |||||
True, dryrun=dryrun, interactive=interactive) | True, dryrun=dryrun, interactive=interactive) | ||||
@annotatesubrepoerror | @annotatesubrepoerror | ||||
def removefiles(self, matcher, prefix, after, force, subrepos, | def removefiles(self, matcher, prefix, after, force, subrepos, | ||||
dryrun, warnings): | dryrun, warnings): | ||||
return cmdutil.remove(self.ui, self._repo, matcher, prefix, | return cmdutil.remove(self.ui, self._repo, matcher, prefix, | ||||
after, force, subrepos, dryrun) | after, force, subrepos, dryrun) | ||||