equal
deleted
inserted
replaced
53 |
53 |
54 def hook(self, name, throw=False, **args): |
54 def hook(self, name, throw=False, **args): |
55 def runhook(name, cmd): |
55 def runhook(name, cmd): |
56 self.ui.note(_("running hook %s: %s\n") % (name, cmd)) |
56 self.ui.note(_("running hook %s: %s\n") % (name, cmd)) |
57 env = dict([('HG_' + k.upper(), v) for k, v in args.iteritems()]) |
57 env = dict([('HG_' + k.upper(), v) for k, v in args.iteritems()]) |
58 r = util.esystem(cmd, environ=env, cwd=self.root) |
58 r = util.system(cmd, environ=env, cwd=self.root) |
59 if r: |
59 if r: |
60 desc, r = util.explain_exit(r) |
60 desc, r = util.explain_exit(r) |
61 if throw: |
61 if throw: |
62 raise util.Abort(_('%s hook %s') % (name, desc)) |
62 raise util.Abort(_('%s hook %s') % (name, desc)) |
63 self.ui.warn(_('error: %s hook %s\n') % (name, desc)) |
63 self.ui.warn(_('error: %s hook %s\n') % (name, desc)) |