largefiles: support revsets for cat
Previous to this, cat only accepted revsets if the largefiles extension was
disabled.
--- a/hgext/largefiles/overrides.py Fri Jul 20 18:13:19 2012 -0400
+++ b/hgext/largefiles/overrides.py Fri Jul 20 19:14:41 2012 -0400
@@ -1075,8 +1075,8 @@
return result
def overridecat(orig, ui, repo, file1, *pats, **opts):
- rev = opts.get('rev')
- if not lfutil.standin(file1) in repo[rev]:
+ 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, opts.get('rev'), opts.get('output'))
+ return lfcommands.catlfile(repo, file1, ctx.rev(), opts.get('output'))
--- a/tests/test-largefiles.t Fri Jul 20 18:13:19 2012 -0400
+++ b/tests/test-largefiles.t Fri Jul 20 19:14:41 2012 -0400
@@ -1032,6 +1032,10 @@
$ rm cat.out
$ hg cat -r a381d2c8c80e normal3
normal3-modified
+ $ hg cat -r '.^' normal3
+ normal3-modified
+ $ hg cat -r '.^' sub/large4
+ large4-modified
Test that renaming a largefile results in correct output for status