# HG changeset patch # User Matt Mackall # Date 1182696474 18000 # Node ID 5b2d986de0f8a3c2d5ae99e8aa52419c4971711e # Parent 59b8f9361545aaa3565662b0c17202183769b86d cat: return an error on failure diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -342,10 +342,13 @@ def cat(ui, repo, file1, *pats, **opts): %p root-relative path name of file being printed """ ctx = repo.changectx(opts['rev']) + err = 1 for src, abs, rel, exact in cmdutil.walk(repo, (file1,) + pats, opts, ctx.node()): fp = cmdutil.make_file(repo, opts['output'], ctx.node(), pathname=abs) fp.write(ctx.filectx(abs).data()) + err = 0 + return err def clone(ui, source, dest=None, **opts): """make a copy of an existing repository