largefiles: support revsets for cat stable
authorMatt Harbison <matt_harbison@yahoo.com>
Fri, 20 Jul 2012 19:14:41 -0400
branchstable
changeset 17269 acfab0754584
parent 17268 8c31b652bdfe
child 17270 32246faba53a
largefiles: support revsets for cat Previous to this, cat only accepted revsets if the largefiles extension was disabled.
hgext/largefiles/overrides.py
tests/test-largefiles.t
--- 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