Mercurial > public > mercurial-scm > hg
comparison mercurial/subrepo.py @ 16529:3d5d204a08c7 stable
subrepo/svn: abort on commit with missing file (issue3029)
Previous code was printing a traceback because it expected some error output
from svn. But sometimes our definition of "changed" differs with the subversion
one. For instance, subversion ignores missing files when committing. And when
there are only missing files, svn commit will be a successful no-op with no
output. Still, we should stick to our definition including missing files in
changes as doing otherwise could cause surprising behaviour for the user.
author | Patrick Mezard <patrick@mezard.eu> |
---|---|
date | Thu, 26 Apr 2012 11:55:07 +0200 |
parents | 17a1f7690b49 |
children | e37199a1f9d4 |
comparison
equal
deleted
inserted
replaced
16528:5d803620ca05 | 16529:3d5d204a08c7 |
---|---|
724 raise util.Abort(_('cannot commit svn externals')) | 724 raise util.Abort(_('cannot commit svn externals')) |
725 commitinfo, err = self._svncommand(['commit', '-m', text]) | 725 commitinfo, err = self._svncommand(['commit', '-m', text]) |
726 self._ui.status(commitinfo) | 726 self._ui.status(commitinfo) |
727 newrev = re.search('Committed revision ([0-9]+).', commitinfo) | 727 newrev = re.search('Committed revision ([0-9]+).', commitinfo) |
728 if not newrev: | 728 if not newrev: |
729 if not commitinfo.strip(): | |
730 # Sometimes, our definition of "changed" differs from | |
731 # svn one. For instance, svn ignores missing files | |
732 # when committing. If there are only missing files, no | |
733 # commit is made, no output and no error code. | |
734 raise util.Abort(_('failed to commit svn changes')) | |
729 raise util.Abort(commitinfo.splitlines()[-1]) | 735 raise util.Abort(commitinfo.splitlines()[-1]) |
730 newrev = newrev.groups()[0] | 736 newrev = newrev.groups()[0] |
731 self._ui.status(self._svncommand(['update', '-r', newrev])[0]) | 737 self._ui.status(self._svncommand(['update', '-r', newrev])[0]) |
732 return newrev | 738 return newrev |
733 | 739 |