changeset 35769:f00edef84c3b

lfs: rename {lfsattrs} to {pointer} This seems more descriptive.
author Matt Harbison <matt_harbison@yahoo.com>
date Fri, 19 Jan 2018 19:20:50 -0500
parents 60a6ab7bcda7
children 0aafeded7957
files hgext/lfs/__init__.py tests/test-lfs.t
diffstat 2 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/lfs/__init__.py	Fri Jan 19 21:29:31 2018 -0500
+++ b/hgext/lfs/__init__.py	Fri Jan 19 19:20:50 2018 -0500
@@ -362,7 +362,7 @@
     pointers = wrapper.pointersfromctx(ctx) # {path: pointer}
     files = sorted(pointers.keys())
 
-    def lfsattrs(v):
+    def pointer(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)
@@ -371,7 +371,7 @@
     makemap = lambda v: {
         'file': v,
         'oid': pointers[v].oid(),
-        'lfsattrs': templatekw.hybriddict(lfsattrs(v)),
+        'pointer': templatekw.hybriddict(pointer(v)),
     }
 
     # TODO: make the separator ', '?
--- a/tests/test-lfs.t	Fri Jan 19 21:29:31 2018 -0500
+++ b/tests/test-lfs.t	Fri Jan 19 19:20:50 2018 -0500
@@ -865,16 +865,16 @@
   oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
   size 29
   x-is-binary 0
-  $ hg --cwd convert_lfs log -r 0 -T "{lfs_files % '{lfsattrs % '{key}={value}\n'}'}"
+  $ hg --cwd convert_lfs log -r 0 -T "{lfs_files % '{pointer % '{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"}'
+  >    -T '{lfs_files % "{get(pointer, "oid")}\n"}{lfs_files % "{pointer.oid}\n"}'
   sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
   sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
-  $ hg --cwd convert_lfs log -r 0 -T '{lfs_files % "{lfsattrs}\n"}'
+  $ hg --cwd convert_lfs log -r 0 -T '{lfs_files % "{pointer}\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"}'