equal
deleted
inserted
replaced
52 pass |
52 pass |
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 [(k.upper(), v) for k, v in args.iteritems()]) |
58 r = util.system(cmd, environ=env, cwd=self.root) |
59 r = util.system(cmd, environ=env, cwd=self.root) |
59 if r: |
60 if r: |
60 desc, r = util.explain_exit(r) |
61 desc, r = util.explain_exit(r) |
61 if throw: |
62 if throw: |
62 raise util.Abort(_('%s hook %s') % (name, desc)) |
63 raise util.Abort(_('%s hook %s') % (name, desc)) |