diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -2097,9 +2097,10 @@ for subpath in sorted(wctx.substate): sub = wctx.sub(subpath) + submatch = matchmod.subdirmatcher(subpath, match) + subprefix = repo.wvfs.reljoin(prefix, subpath) try: - submatch = matchmod.subdirmatcher(subpath, match) - subbad, subforgot = sub.forget(submatch, prefix, dryrun=dryrun, + subbad, subforgot = sub.forget(submatch, subprefix, dryrun=dryrun, interactive=interactive) bad.extend([subpath + '/' + f for f in subbad]) forgot.extend([subpath + '/' + f for f in subforgot]) diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py --- a/mercurial/subrepo.py +++ b/mercurial/subrepo.py @@ -840,8 +840,7 @@ @annotatesubrepoerror def forget(self, match, prefix, dryrun, interactive): - return cmdutil.forget(self.ui, self._repo, match, - self.wvfs.reljoin(prefix, self._path), + return cmdutil.forget(self.ui, self._repo, match, prefix, True, dryrun=dryrun, interactive=interactive) @annotatesubrepoerror