diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -4652,6 +4652,10 @@ def revert(ui, repo, *pats, **opts): def badfn(path, msg): if path in names: return + if path in repo[node].substate: + ui.warn("%s: %s\n" % (m.rel(path), + 'reverting subrepos is unsupported')) + return path_ = path + '/' for f in names: if f.startswith(path_): diff --git a/tests/test-subrepo.t b/tests/test-subrepo.t --- a/tests/test-subrepo.t +++ b/tests/test-subrepo.t @@ -34,6 +34,18 @@ Issue2232: committing a subrepo without $ hg ci -m1 committing subrepository s +Revert can't (yet) revert subrepos: + + $ echo b > s/a + $ hg revert s + s: reverting subrepos is unsupported + +Revert currently ignores subrepos by default + + $ hg revert -a + $ hg revert -R s -a -C + reverting s/a + Issue2022: update -C $ echo b > s/a