Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHG5ee3c49fc9cd: subrepo: adjust subrepo prefix before calling subrepo.addremove() (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/scmutil.py (3 lines) | |||
M | mercurial/subrepo.py (3 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
Martin von Zweigbergk | Feb 7 2019, 1:01 PM |
Status | Author | Revision | |
---|---|---|---|
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz |
ret = 0 | ret = 0 | ||||
join = lambda f: os.path.join(prefix, f) | join = lambda f: os.path.join(prefix, f) | ||||
wctx = repo[None] | wctx = repo[None] | ||||
for subpath in sorted(wctx.substate): | for subpath in sorted(wctx.substate): | ||||
submatch = matchmod.subdirmatcher(subpath, m) | submatch = matchmod.subdirmatcher(subpath, m) | ||||
if opts.get('subrepos') or m.exact(subpath) or any(submatch.files()): | if opts.get('subrepos') or m.exact(subpath) or any(submatch.files()): | ||||
sub = wctx.sub(subpath) | sub = wctx.sub(subpath) | ||||
subprefix = repo.wvfs.reljoin(prefix, subpath) | |||||
try: | try: | ||||
if sub.addremove(submatch, prefix, opts): | if sub.addremove(submatch, subprefix, opts): | ||||
ret = 1 | ret = 1 | ||||
except error.LookupError: | except error.LookupError: | ||||
repo.ui.status(_("skipping missing subrepository: %s\n") | repo.ui.status(_("skipping missing subrepository: %s\n") | ||||
% join(subpath)) | % join(subpath)) | ||||
rejected = [] | rejected = [] | ||||
def badfn(f, msg): | def badfn(f, msg): | ||||
if f in m.files(): | if f in m.files(): |
@annotatesubrepoerror | @annotatesubrepoerror | ||||
def addremove(self, m, prefix, opts): | def addremove(self, m, prefix, opts): | ||||
# In the same way as sub directories are processed, once in a subrepo, | # In the same way as sub directories are processed, once in a subrepo, | ||||
# always entry any of its subrepos. Don't corrupt the options that will | # always entry any of its subrepos. Don't corrupt the options that will | ||||
# be used to process sibling subrepos however. | # be used to process sibling subrepos however. | ||||
opts = copy.copy(opts) | opts = copy.copy(opts) | ||||
opts['subrepos'] = True | opts['subrepos'] = True | ||||
return scmutil.addremove(self._repo, m, | return scmutil.addremove(self._repo, m, prefix, opts) | ||||
self.wvfs.reljoin(prefix, self._path), opts) | |||||
@annotatesubrepoerror | @annotatesubrepoerror | ||||
def cat(self, match, fm, fntemplate, prefix, **opts): | def cat(self, match, fm, fntemplate, prefix, **opts): | ||||
rev = self._state[1] | rev = self._state[1] | ||||
ctx = self._repo[rev] | ctx = self._repo[rev] | ||||
return cmdutil.cat(self.ui, self._repo, ctx, match, fm, fntemplate, | return cmdutil.cat(self.ui, self._repo, ctx, match, fm, fntemplate, | ||||
prefix, **opts) | prefix, **opts) | ||||