diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py index 5d803620ca0553094e0a5f1c33cad8c48ef7e277_bWVyY3VyaWFsL3N1YnJlcG8ucHk=..3d5d204a08c7c58b3cf21349ca95d3b85fdd27c7_bWVyY3VyaWFsL3N1YnJlcG8ucHk= 100644 --- a/mercurial/subrepo.py +++ b/mercurial/subrepo.py @@ -726,6 +726,12 @@ self._ui.status(commitinfo) newrev = re.search('Committed revision ([0-9]+).', commitinfo) if not newrev: + if not commitinfo.strip(): + # Sometimes, our definition of "changed" differs from + # svn one. For instance, svn ignores missing files + # when committing. If there are only missing files, no + # commit is made, no output and no error code. + raise util.Abort(_('failed to commit svn changes')) raise util.Abort(commitinfo.splitlines()[-1]) newrev = newrev.groups()[0] self._ui.status(self._svncommand(['update', '-r', newrev])[0]) diff --git a/tests/test-subrepo-svn.t b/tests/test-subrepo-svn.t index 5d803620ca0553094e0a5f1c33cad8c48ef7e277_dGVzdHMvdGVzdC1zdWJyZXBvLXN2bi50..3d5d204a08c7c58b3cf21349ca95d3b85fdd27c7_dGVzdHMvdGVzdC1zdWJyZXBvLXN2bi50 100644 --- a/tests/test-subrepo-svn.t +++ b/tests/test-subrepo-svn.t @@ -120,6 +120,15 @@ source file://*/svn-repo/src (glob) revision 2 +missing svn file, commit should fail + + $ rm s/alpha + $ hg commit --subrepos -m 'abort on missing file' + committing subrepository s + abort: failed to commit svn changes + [255] + $ svn revert s/alpha > /dev/null + add an unrelated revision in svn and update the subrepo to without bringing any changes.