changeset 17269:acfab0754584 stable

largefiles: support revsets for cat Previous to this, cat only accepted revsets if the largefiles extension was disabled.
author Matt Harbison <matt_harbison@yahoo.com>
date Fri, 20 Jul 2012 19:14:41 -0400
parents 8c31b652bdfe
children 32246faba53a
files hgext/largefiles/overrides.py tests/test-largefiles.t
diffstat 2 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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