hgext/lfs/__init__.py
changeset 35769 f00edef84c3b
parent 35768 60a6ab7bcda7
child 35797 76cb752af07a
equal deleted inserted replaced
35768:60a6ab7bcda7 35769:f00edef84c3b
   360     args = pycompat.byteskwargs(args)
   360     args = pycompat.byteskwargs(args)
   361 
   361 
   362     pointers = wrapper.pointersfromctx(ctx) # {path: pointer}
   362     pointers = wrapper.pointersfromctx(ctx) # {path: pointer}
   363     files = sorted(pointers.keys())
   363     files = sorted(pointers.keys())
   364 
   364 
   365     def lfsattrs(v):
   365     def pointer(v):
   366         # In the file spec, version is first and the other keys are sorted.
   366         # In the file spec, version is first and the other keys are sorted.
   367         sortkeyfunc = lambda x: (x[0] != 'version', x)
   367         sortkeyfunc = lambda x: (x[0] != 'version', x)
   368         items = sorted(pointers[v].iteritems(), key=sortkeyfunc)
   368         items = sorted(pointers[v].iteritems(), key=sortkeyfunc)
   369         return util.sortdict(items)
   369         return util.sortdict(items)
   370 
   370 
   371     makemap = lambda v: {
   371     makemap = lambda v: {
   372         'file': v,
   372         'file': v,
   373         'oid': pointers[v].oid(),
   373         'oid': pointers[v].oid(),
   374         'lfsattrs': templatekw.hybriddict(lfsattrs(v)),
   374         'pointer': templatekw.hybriddict(pointer(v)),
   375     }
   375     }
   376 
   376 
   377     # TODO: make the separator ', '?
   377     # TODO: make the separator ', '?
   378     f = templatekw._showlist('lfs_file', files, args)
   378     f = templatekw._showlist('lfs_file', files, args)
   379     return templatekw._hybrid(f, files, makemap, pycompat.identity)
   379     return templatekw._hybrid(f, files, makemap, pycompat.identity)