Patchwork [2,of,3,STABLE] lfs: rename {oid} to {lfsoid}

login
register
mail settings
Submitter Matt Harbison
Date Jan. 24, 2018, 2:37 a.m.
Message ID <882ea5de2df75eb058e8.1516761463@Envy>
Download mbox | patch
Permalink /patch/27056/
State Accepted
Headers show

Comments

Matt Harbison - Jan. 24, 2018, 2:37 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1516758602 18000
#      Tue Jan 23 20:50:02 2018 -0500
# Branch stable
# Node ID 882ea5de2df75eb058e8c8fa583e59ef61739b3c
# Parent  c12195501c406b30a15c796b4b728303cd189575
lfs: rename {oid} to {lfsoid}

Per Yuya, for consistency with {lfspointer}.  It might be slightly confusing for
there to be {lfsoid} and {lfspointer.oid}.  But preventing ambiguity seems more
important, and the latter is controlled by the git-lfs spec.

Patch

diff --git a/hgext/lfs/__init__.py b/hgext/lfs/__init__.py
--- a/hgext/lfs/__init__.py
+++ b/hgext/lfs/__init__.py
@@ -370,7 +370,7 @@ 
 
     makemap = lambda v: {
         'file': v,
-        'oid': pointers[v].oid(),
+        'lfsoid': pointers[v].oid(),
         'lfspointer': templatekw.hybriddict(pointer(v)),
     }
 
diff --git a/tests/test-lfs.t b/tests/test-lfs.t
--- a/tests/test-lfs.t
+++ b/tests/test-lfs.t
@@ -877,7 +877,7 @@ 
   $ hg --cwd convert_lfs log -r 0 -T '{lfs_files % "{lfspointer}\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"}'
+  >     log -r 'all()' -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}'
   0: a1: 5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
   1: a2: 5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
   2: a2: 876dadc86a8542f9798048f2c47f51dbf8e4359aed883e8ec80c5db825f0d943
@@ -987,7 +987,7 @@ 
   $ echo '012345678901234567890' > nolfs.exclude
   $ echo '01234567890123456' > lfs.catchall
   $ hg ci -Aqm 'added .hglfs'
-  $ hg log -r . -T '{rev}: {lfs_files % "{file}: {oid}\n"}\n'
+  $ hg log -r . -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}\n'
   2: lfs.catchall: d4ec46c2869ba22eceb42a729377432052d9dd75d82fc40390ebaadecee87ee9
   lfs.test: 5489e6ced8c36a7b267292bde9fd5242a5f80a7482e8f23fa0477393dfaa4d6c
   
@@ -997,7 +997,7 @@ 
   $ echo '012345678901234567890a' > nolfs.exclude
   $ echo '01234567890123456a' > lfs.catchall
   $ hg ci -qm 'unmodified .hglfs'
-  $ hg log -r . -T '{rev}: {lfs_files % "{file}: {oid}\n"}\n'
+  $ hg log -r . -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}\n'
   3: lfs.catchall: 31f43b9c62b540126b0ad5884dc013d21a61c9329b77de1fceeae2fc58511573
   lfs.test: 8acd23467967bc7b8cc5a280056589b0ba0b17ff21dbd88a7b6474d6290378a6
   
@@ -1008,7 +1008,7 @@ 
   $ echo '012345678901234567890abc' > nolfs.exclude
   $ echo '01234567890123456abc' > lfs.catchall
   $ hg ci -qm 'file test' -X .hglfs
-  $ hg log -r . -T '{rev}: {lfs_files % "{file}: {oid}\n"}\n'
+  $ hg log -r . -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}\n'
   4: lfs.catchall: 6747cfb1b83965b4a884e7a6061813ae31e4122028bc6a88d2ac5e5f9e05c5af
   lfs.test: 3f40b70c2294e91e0fa789ebcf73c5a1d1c7aef270f83e477e40cb0513237e8c
   
@@ -1018,7 +1018,7 @@ 
   $ echo '012345678901234567890abcdef' > nolfs.exclude
   $ echo '01234567890123456abcdef' > lfs.catchall
   $ hg ci -qm 'file test'
-  $ hg log -r . -T '{rev}: {lfs_files % "{file}: {oid}\n"}\n'
+  $ hg log -r . -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}\n'
   5: 
 
   $ cd ..