lfs: rename {lfsattrs} to {pointer}
authorMatt Harbison <matt_harbison@yahoo.com>
Fri, 19 Jan 2018 19:20:50 -0500
changeset 35769 f00edef84c3b
parent 35768 60a6ab7bcda7
child 35770 0aafeded7957
lfs: rename {lfsattrs} to {pointer} This seems more descriptive.
hgext/lfs/__init__.py
tests/test-lfs.t
--- 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"}'