Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 4697:5b2d986de0f8
cat: return an error on failure
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sun, 24 Jun 2007 09:47:54 -0500 |
parents | c135c6cddbec |
children | a6b62584d0b2 |
comparison
equal
deleted
inserted
replaced
4696:59b8f9361545 | 4697:5b2d986de0f8 |
---|---|
340 %s basename of file being printed | 340 %s basename of file being printed |
341 %d dirname of file being printed, or '.' if in repo root | 341 %d dirname of file being printed, or '.' if in repo root |
342 %p root-relative path name of file being printed | 342 %p root-relative path name of file being printed |
343 """ | 343 """ |
344 ctx = repo.changectx(opts['rev']) | 344 ctx = repo.changectx(opts['rev']) |
345 err = 1 | |
345 for src, abs, rel, exact in cmdutil.walk(repo, (file1,) + pats, opts, | 346 for src, abs, rel, exact in cmdutil.walk(repo, (file1,) + pats, opts, |
346 ctx.node()): | 347 ctx.node()): |
347 fp = cmdutil.make_file(repo, opts['output'], ctx.node(), pathname=abs) | 348 fp = cmdutil.make_file(repo, opts['output'], ctx.node(), pathname=abs) |
348 fp.write(ctx.filectx(abs).data()) | 349 fp.write(ctx.filectx(abs).data()) |
350 err = 0 | |
351 return err | |
349 | 352 |
350 def clone(ui, source, dest=None, **opts): | 353 def clone(ui, source, dest=None, **opts): |
351 """make a copy of an existing repository | 354 """make a copy of an existing repository |
352 | 355 |
353 Create a copy of an existing repository in a new directory. | 356 Create a copy of an existing repository in a new directory. |