changeset 21:003eee5497e0

* Hotfixed onsub for use with mercurial 4.1+
author Matthias Muenzner <matthias.muenzner@jkaref.com>
date Mon, 08 May 2017 20:03:41 +0200
parents 132e522fda32
children f21f26513968
files onsub.py
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/onsub.py	Wed May 18 16:30:12 2016 +0300
+++ b/onsub.py	Mon May 08 20:03:41 2017 +0200
@@ -116,8 +116,14 @@
                 ui.write(relpath, "\0")
             if cmd != '':
                 if not print0: ui.note(_("executing '%s' in %s\n") % (cmd, relpath))
-                util.system(cmd, environ=envargdict, cwd=cmdwd, onerr=onerr,
-                            errprefix=_('terminated onsub in %s') % relpath)
+                rc = util.system(cmd, environ=envargdict, cwd=cmdwd)
+                if rc:
+                    errprefix=_('terminated onsub in %s') % relpath
+                    errmsg = '%s: %s' % (errprefix, errmsg)
+                    try:
+                        onerr.warn(errmsg + '\n')
+                    except AttributeError:
+                        raise onerr(errmsg)
 
     def bfs():
         """execute precmd in repo.root and in each subrepository, breadth-first"""