Show More
@@ -3029,6 +3029,11 b' def cat(ui, repo, ctx, matcher, basefm, ' | |||||
3029 | if fntemplate: |
|
3029 | if fntemplate: | |
3030 | filename = makefilename(repo, fntemplate, ctx.node(), |
|
3030 | filename = makefilename(repo, fntemplate, ctx.node(), | |
3031 | pathname=os.path.join(prefix, path)) |
|
3031 | pathname=os.path.join(prefix, path)) | |
|
3032 | # attempt to create the directory if it does not already exist | |||
|
3033 | try: | |||
|
3034 | os.makedirs(os.path.dirname(filename)) | |||
|
3035 | except OSError: | |||
|
3036 | pass | |||
3032 | with formatter.maybereopen(basefm, filename, opts) as fm: |
|
3037 | with formatter.maybereopen(basefm, filename, opts) as fm: | |
3033 | data = ctx[path].data() |
|
3038 | data = ctx[path].data() | |
3034 | if opts.get('decode'): |
|
3039 | if opts.get('decode'): |
@@ -126,7 +126,6 b' Test behavior of output when directory s' | |||||
126 | $ echo a > foo/a |
|
126 | $ echo a > foo/a | |
127 | $ hg add foo/a |
|
127 | $ hg add foo/a | |
128 | $ hg commit -qm "add foo/a" |
|
128 | $ hg commit -qm "add foo/a" | |
129 | $ mkdir output |
|
|||
130 | $ hg cat --output "output/%p" foo/a |
|
129 | $ hg cat --output "output/%p" foo/a | |
131 | abort: No such file or directory: output/foo/a |
|
130 | $ cat output/foo/a | |
132 | [255] |
|
131 | a |
General Comments 0
You need to be logged in to leave comments.
Login now