[PATCH] svn subrepo: abort only on nonzero process exit code, no longer assuming warnings are errors (issue2833)
Regis Desgroppes
regis.desgroppes at nokia.com
Tue May 31 05:58:13 CDT 2011
Here's an updated version of the patch, based on the default branch.
The proposed implementation consists in:
- determining if the command failed by only considering the exit code of
the process. This is new.
- if it failed with an error output, aborting with the error output as a
message. This is the same as before.
- it it failed without error output, aborting with a frequently observed
message: "exited with code N". This is new.
- if it succeeded but with an error output, logging the error output as
a warning. This is new.
Additional notes:
- fixed mail composition time typo (extra 'e') reported by Matt.
- favoring single quotes for strings.
- for Augie: no "log and throw" behavior as the error output, if any, is
printed once (abort message xor warning message).
Hope this is acceptable to you now.
# HG changeset patch
# User desgropp <regis.desgroppes at nokia.com>
# Date 1306838482 -7200
# Node ID 922c0b1c1f646a1ba1a94c391438b64a23f61374
# Parent d1a1578c5f7860b17f2f238b2c1e6adb555ffa4f
fixed issue2833: aborts nows depends on svn exit code
diff -r d1a1578c5f78 -r 922c0b1c1f64 mercurial/subrepo.py
--- a/mercurial/subrepo.py Fri May 27 15:59:52 2011 +0200
+++ b/mercurial/subrepo.py Tue May 31 12:41:22 2011 +0200
@@ -547,8 +547,10 @@
universal_newlines=True, env=env)
stdout, stderr = p.communicate()
stderr = stderr.strip()
+ if p.returncode:
+ raise util.Abort(stderr or 'exited with code %d' %
p.returncode)
if stderr:
- raise util.Abort(stderr)
+ self._ui.warn(stderr + '\n')
return stdout
@propertycache
More information about the Mercurial-devel
mailing list