Show More
@@ -466,7 +466,10 b' def cat(ui, repo, file1, *pats, **opts):' | |||||
466 | for src, abs, rel, exact in cmdutil.walk(repo, (file1,) + pats, opts, |
|
466 | for src, abs, rel, exact in cmdutil.walk(repo, (file1,) + pats, opts, | |
467 | ctx.node()): |
|
467 | ctx.node()): | |
468 | fp = cmdutil.make_file(repo, opts['output'], ctx.node(), pathname=abs) |
|
468 | fp = cmdutil.make_file(repo, opts['output'], ctx.node(), pathname=abs) | |
469 |
|
|
469 | data = ctx.filectx(abs).data() | |
|
470 | if opts['decode']: | |||
|
471 | data = repo.wwritedata(abs, data) | |||
|
472 | fp.write(data) | |||
470 | err = 0 |
|
473 | err = 0 | |
471 | return err |
|
474 | return err | |
472 |
|
475 | |||
@@ -2765,6 +2768,7 b' table = {' | |||||
2765 | (cat, |
|
2768 | (cat, | |
2766 | [('o', 'output', '', _('print output to file with formatted name')), |
|
2769 | [('o', 'output', '', _('print output to file with formatted name')), | |
2767 | ('r', 'rev', '', _('print the given revision')), |
|
2770 | ('r', 'rev', '', _('print the given revision')), | |
|
2771 | ('d', 'decode', None, _('apply any matching decode filter')), | |||
2768 | ] + walkopts, |
|
2772 | ] + walkopts, | |
2769 | _('hg cat [OPTION]... FILE...')), |
|
2773 | _('hg cat [OPTION]... FILE...')), | |
2770 | "^clone": |
|
2774 | "^clone": |
@@ -8,6 +8,7 b' echo 0 > b' | |||||
8 | hg ci -A -m m -d "1000000 0" |
|
8 | hg ci -A -m m -d "1000000 0" | |
9 | hg rm a |
|
9 | hg rm a | |
10 | hg cat a |
|
10 | hg cat a | |
|
11 | hg cat --decode a # more tests in test-encode | |||
11 | sleep 1 # make sure mtime is changed |
|
12 | sleep 1 # make sure mtime is changed | |
12 | echo 1 > b |
|
13 | echo 1 > b | |
13 | hg ci -m m -d "1000000 0" |
|
14 | hg ci -m m -d "1000000 0" |
@@ -3,5 +3,6 b' adding b' | |||||
3 | 0 |
|
3 | 0 | |
4 | 0 |
|
4 | 0 | |
5 | 0 |
|
5 | 0 | |
|
6 | 0 | |||
6 | a: No such file in rev 03f6b0774996 |
|
7 | a: No such file in rev 03f6b0774996 | |
7 | 1 |
|
8 | 1 |
@@ -21,6 +21,7 b' options:' | |||||
21 |
|
21 | |||
22 | -o --output print output to file with formatted name |
|
22 | -o --output print output to file with formatted name | |
23 | -r --rev print the given revision |
|
23 | -r --rev print the given revision | |
|
24 | -d --decode apply any matching decode filter | |||
24 | -I --include include names matching the given patterns |
|
25 | -I --include include names matching the given patterns | |
25 | -X --exclude exclude names matching the given patterns |
|
26 | -X --exclude exclude names matching the given patterns | |
26 |
|
27 |
@@ -32,3 +32,11 b' hg co' | |||||
32 |
|
32 | |||
33 | echo %% uncompress our new working dir copy |
|
33 | echo %% uncompress our new working dir copy | |
34 | gunzip < a.gz |
|
34 | gunzip < a.gz | |
|
35 | ||||
|
36 | echo %% check hg cat operation | |||
|
37 | hg cat a.gz | |||
|
38 | hg cat -d a.gz | gunzip | |||
|
39 | mkdir subdir | |||
|
40 | cd subdir | |||
|
41 | hg -R .. cat ../a.gz | |||
|
42 | hg -R .. cat -d ../a.gz | gunzip |
@@ -7,3 +7,8 b' this is a test' | |||||
7 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
7 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
8 | %% uncompress our new working dir copy |
|
8 | %% uncompress our new working dir copy | |
9 | this is a test |
|
9 | this is a test | |
|
10 | %% check hg cat operation | |||
|
11 | this is a test | |||
|
12 | this is a test | |||
|
13 | this is a test | |||
|
14 | this is a test |
General Comments 0
You need to be logged in to leave comments.
Login now