diff tests/test-lfs.t @ 35731:f58245b9e3ea

lfs: add the '{lfsattrs}' template keyword to '{lfs_files}' This provides access to the metadata dictionary contained within the tracked pointer file. The OID is probably the most important attribute, and has its own keyword. But we might as well have this for completeness. I liked {pointer} better, but couldn't make it work with the singular/plural forms.
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 14 Jan 2018 17:00:24 -0500
parents 1ad1e59b405e
children f00edef84c3b
line wrap: on
line diff
--- a/tests/test-lfs.t	Thu Jan 18 16:47:14 2018 +0100
+++ b/tests/test-lfs.t	Sun Jan 14 17:00:24 2018 -0500
@@ -865,6 +865,17 @@
   oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
   size 29
   x-is-binary 0
+  $ hg --cwd convert_lfs log -r 0 -T "{lfs_files % '{lfsattrs % '{key}={value}\n'}'}"
+  version=https://git-lfs.github.com/spec/v1
+  oid=sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
+  size=29
+  x-is-binary=0
+  $ hg --cwd convert_lfs log -r 0 \
+  >    -T '{lfs_files % "{get(lfsattrs, "oid")}\n"}{lfs_files % "{lfsattrs.oid}\n"}'
+  sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
+  sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
+  $ hg --cwd convert_lfs log -r 0 -T '{lfs_files % "{lfsattrs}\n"}'
+  version=https://git-lfs.github.com/spec/v1 oid=sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024 size=29 x-is-binary=0
   $ hg --cwd convert_lfs \
   >     log -r 'all()' -T '{rev}: {lfs_files % "{file}: {oid}\n"}'
   0: a1: 5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024