Mercurial > public > mercurial-scm > hg-stable
diff hgext/largefiles/overrides.py @ 18491:b7da9c042b9e stable
largefiles: fix cat when using relative paths from subdirectory
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Fri, 25 Jan 2013 18:20:13 +0100 |
parents | c9db897d5a43 |
children | 139529b0a191 2dc7f63181b9 |
line wrap: on
line diff
--- a/hgext/largefiles/overrides.py Fri Jan 25 16:59:34 2013 +0100 +++ b/hgext/largefiles/overrides.py Fri Jan 25 18:20:13 2013 +0100 @@ -1149,10 +1149,25 @@ def overridecat(orig, ui, repo, file1, *pats, **opts): ctx = scmutil.revsingle(repo, opts.get('rev')) - if not lfutil.standin(file1) in ctx: - result = orig(ui, repo, file1, *pats, **opts) - return result - return lfcommands.catlfile(repo, file1, ctx.rev(), opts.get('output')) + err = 1 + notbad = set() + m = scmutil.match(ctx, (file1,) + pats, opts) + origmatchfn = m.matchfn + def lfmatchfn(f): + lf = lfutil.splitstandin(f) + if lf is None: + return origmatchfn(f) + notbad.add(lf) + return origmatchfn(lf) + m.matchfn = lfmatchfn + m.bad = lambda f, msg: f not in notbad + for f in ctx.walk(m): + lf = lfutil.splitstandin(f) + if lf is None: + err = orig(ui, repo, f, **opts) + else: + err = lfcommands.catlfile(repo, lf, ctx.rev(), opts.get('output')) + return err def mercurialsinkbefore(orig, sink): sink.repo._isconverting = True