1715 return result |
1715 return result |
1716 |
1716 |
1717 |
1717 |
1718 @eh.wrapcommand(b'cat') |
1718 @eh.wrapcommand(b'cat') |
1719 def overridecat(orig, ui, repo, file1, *pats, **opts): |
1719 def overridecat(orig, ui, repo, file1, *pats, **opts): |
1720 opts = pycompat.byteskwargs(opts) |
1720 ctx = logcmdutil.revsingle(repo, opts.get('rev')) |
1721 ctx = logcmdutil.revsingle(repo, opts.get(b'rev')) |
|
1722 err = 1 |
1721 err = 1 |
1723 notbad = set() |
1722 notbad = set() |
1724 m = scmutil.match(ctx, (file1,) + pats, opts) |
1723 m = scmutil.match(ctx, (file1,) + pats, pycompat.byteskwargs(opts)) |
1725 origmatchfn = m.matchfn |
1724 origmatchfn = m.matchfn |
1726 |
1725 |
1727 def lfmatchfn(f): |
1726 def lfmatchfn(f): |
1728 if origmatchfn(f): |
1727 if origmatchfn(f): |
1729 return True |
1728 return True |
1756 return origvisitdirfn(lf) |
1755 return origvisitdirfn(lf) |
1757 |
1756 |
1758 m.visitdir = lfvisitdirfn |
1757 m.visitdir = lfvisitdirfn |
1759 |
1758 |
1760 for f in ctx.walk(m): |
1759 for f in ctx.walk(m): |
1761 with cmdutil.makefileobj(ctx, opts.get(b'output'), pathname=f) as fp: |
1760 with cmdutil.makefileobj(ctx, opts.get('output'), pathname=f) as fp: |
1762 lf = lfutil.splitstandin(f) |
1761 lf = lfutil.splitstandin(f) |
1763 if lf is None or origmatchfn(f): |
1762 if lf is None or origmatchfn(f): |
1764 # duplicating unreachable code from commands.cat |
1763 # duplicating unreachable code from commands.cat |
1765 data = ctx[f].data() |
1764 data = ctx[f].data() |
1766 if opts.get(b'decode'): |
1765 if opts.get('decode'): |
1767 data = repo.wwritedata(f, data) |
1766 data = repo.wwritedata(f, data) |
1768 fp.write(data) |
1767 fp.write(data) |
1769 else: |
1768 else: |
1770 hash = lfutil.readasstandin(ctx[f]) |
1769 hash = lfutil.readasstandin(ctx[f]) |
1771 if not lfutil.inusercache(repo.ui, hash): |
1770 if not lfutil.inusercache(repo.ui, hash): |