hgext/lfs/__init__.py
changeset 35731 f58245b9e3ea
parent 35665 1ad1e59b405e
child 35732 10e62d5efa73
--- a/hgext/lfs/__init__.py	Thu Jan 18 16:47:14 2018 +0100
+++ b/hgext/lfs/__init__.py	Sun Jan 14 17:00:24 2018 -0500
@@ -97,6 +97,7 @@
     scmutil,
     templatekw,
     upgrade,
+    util,
     vfs as vfsmod,
     wireproto,
 )
@@ -311,9 +312,16 @@
     pointers = wrapper.pointersfromctx(ctx) # {path: pointer}
     files = sorted(pointers.keys())
 
+    def lfsattrs(v):
+        # In the file spec, version is first and the other keys are sorted.
+        sortkeyfunc = lambda x: (x[0] != 'version', x)
+        items = sorted(pointers[v].iteritems(), key=sortkeyfunc)
+        return util.sortdict(items)
+
     makemap = lambda v: {
         'file': v,
         'oid': pointers[v].oid(),
+        'lfsattrs': templatekw.hybriddict(lfsattrs(v)),
     }
 
     # TODO: make the separator ', '?