Patchwork lfs: rename {pointer} to {lfs_pointer}

login
register
mail settings
Submitter Matt Harbison
Date Jan. 22, 2018, 10:58 p.m.
Message ID <9587a034e4e8d640a37b.1516661885@MATT7H-PC.attotech.com>
Download mbox | patch
Permalink /patch/27053/
State New
Headers show

Comments

Matt Harbison - Jan. 22, 2018, 10:58 p.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1516661260 18000
#      Mon Jan 22 17:47:40 2018 -0500
# Node ID 9587a034e4e8d640a37bb38b3ba1cc116fd4029e
# Parent  4fb2bb61597cb34c69c4af7a2d1fb0bb43145eb1
lfs: rename {pointer} to {lfs_pointer}

Per Martin von Zweigbergk's suggestion to keep this unambiguous, for when it is
migrated to {files} and friends.
Augie Fackler - Jan. 23, 2018, 1:08 a.m.
> On Jan 22, 2018, at 17:58, Matt Harbison <mharbison72@gmail.com> wrote:
> 
> # HG changeset patch
> # User Matt Harbison <matt_harbison@yahoo.com>
> # Date 1516661260 18000
> #      Mon Jan 22 17:47:40 2018 -0500
> # Node ID 9587a034e4e8d640a37bb38b3ba1cc116fd4029e
> # Parent  4fb2bb61597cb34c69c4af7a2d1fb0bb43145eb1
> lfs: rename {pointer} to {lfs_pointer}

I like it. Yuya, how does this feel to you?
Yuya Nishihara - Jan. 23, 2018, 3:37 a.m.
On Jan 23, 2018 10:08 AM, "Augie Fackler" <raf@durin42.com> wrote:



> On Jan 22, 2018, at 17:58, Matt Harbison <mharbison72@gmail.com> wrote:
>
> # HG changeset patch
> # User Matt Harbison <matt_harbison@yahoo.com>
> # Date 1516661260 18000
> #      Mon Jan 22 17:47:40 2018 -0500
> # Node ID 9587a034e4e8d640a37bb38b3ba1cc116fd4029e
> # Parent  4fb2bb61597cb34c69c4af7a2d1fb0bb43145eb1
> lfs: rename {pointer} to {lfs_pointer}

I like it. Yuya, how does this feel to you?


Seems fine, but we should rename {oid} as well.
And I prefer {lfspointer} (no underscore) as per the current naming
convention.

Patch

diff --git a/hgext/lfs/__init__.py b/hgext/lfs/__init__.py
--- a/hgext/lfs/__init__.py
+++ b/hgext/lfs/__init__.py
@@ -371,7 +371,7 @@  def lfsfiles(repo, ctx, **args):
     makemap = lambda v: {
         'file': v,
         'oid': pointers[v].oid(),
-        'pointer': templatekw.hybriddict(pointer(v)),
+        'lfs_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 @@  there's no 'lfs' destination repo requir
   oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
   size 29
   x-is-binary 0
-  $ hg --cwd convert_lfs log -r 0 -T "{lfs_files % '{pointer % '{key}={value}\n'}'}"
+  $ hg --cwd convert_lfs log -r 0 -T "{lfs_files % '{lfs_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(pointer, "oid")}\n"}{lfs_files % "{pointer.oid}\n"}'
+  >    -T '{lfs_files % "{get(lfs_pointer, "oid")}\n"}{lfs_files % "{lfs_pointer.oid}\n"}'
   sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
   sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
-  $ hg --cwd convert_lfs log -r 0 -T '{lfs_files % "{pointer}\n"}'
+  $ hg --cwd convert_lfs log -r 0 -T '{lfs_files % "{lfs_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"}'