diff hgext/lfs/wrapper.py @ 35663:a985834961f7

lfs: allow the pointer file to be viewed with `hg cat -T '{rawdata}'` The only other interface to this data is `hg debugdata`, which requires knowledge of the filelog revision that corresponds to the changeset. Since the data is uninterpreted, this is an important debugging capability, and needs to be simpler to use than that. For non-LFS files, this displays the regular data. Alternately, we could forego the messy function extraction in the last patch if this template keyword can just be added unconditionally.
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 16 Jan 2018 20:15:07 -0500
parents 588d02d9208a
children b91bca85ba73
line wrap: on
line diff
--- a/hgext/lfs/wrapper.py	Tue Jan 16 19:56:00 2018 -0500
+++ b/hgext/lfs/wrapper.py	Tue Jan 16 20:15:07 2018 -0500
@@ -179,6 +179,10 @@
 def filectxislfs(self):
     return _islfs(self.filelog(), self.filenode())
 
+def _updatecatformatter(orig, fm, ctx, matcher, path, decode):
+    orig(fm, ctx, matcher, path, decode)
+    fm.data(rawdata=ctx[path].rawdata())
+
 def convertsink(orig, sink):
     sink = orig(sink)
     if sink.repotype == 'hg':