Patchwork lfs: rename {lfsattrs} to {pointer}

login
register
mail settings
Submitter Matt Harbison
Date Jan. 20, 2018, 7:52 a.m.
Message ID <9179400df335ad78c59f.1516434750@Envy>
Download mbox | patch
Permalink /patch/27001/
State Accepted
Headers show

Comments

Matt Harbison - Jan. 20, 2018, 7:52 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1516407650 18000
#      Fri Jan 19 19:20:50 2018 -0500
# Node ID 9179400df335ad78c59f165cea811471905ec51a
# Parent  069df0b952e803b3efb3c59c423522a4800ecde4
lfs: rename {lfsattrs} to {pointer}

This seems more descriptive.
Yuya Nishihara - Jan. 20, 2018, 7:58 a.m.
On Sat, 20 Jan 2018 02:52:30 -0500, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison@yahoo.com>
> # Date 1516407650 18000
> #      Fri Jan 19 19:20:50 2018 -0500
> # Node ID 9179400df335ad78c59f165cea811471905ec51a
> # Parent  069df0b952e803b3efb3c59c423522a4800ecde4
> lfs: rename {lfsattrs} to {pointer}

Queued, thanks.

(The code freeze is in effect, but I think it's better to not release new
feature that will be deprecated soon. And this change is trivial.)

Patch

diff --git a/hgext/lfs/__init__.py b/hgext/lfs/__init__.py
--- a/hgext/lfs/__init__.py
+++ b/hgext/lfs/__init__.py
@@ -315,7 +315,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)
@@ -324,7 +324,7 @@ 
     makemap = lambda v: {
         'file': v,
         'oid': pointers[v].oid(),
-        'lfsattrs': templatekw.hybriddict(lfsattrs(v)),
+        'pointer': templatekw.hybriddict(pointer(v)),
     }
 
     # TODO: make the separator ', '?
diff --git a/tests/test-lfs.t b/tests/test-lfs.t
--- a/tests/test-lfs.t
+++ b/tests/test-lfs.t
@@ -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"}'