diff hgext/lfs/__init__.py @ 35999:8c7d5e90e6bd

lfs: teach '{lfs_files}' to handle removed files
author Matt Harbison <matt_harbison@yahoo.com>
date Sat, 27 Jan 2018 19:22:15 -0500
parents eefb5d603482
children 91aac8e6604d
line wrap: on
line diff
--- a/hgext/lfs/__init__.py	Sat Jan 27 18:56:24 2018 -0500
+++ b/hgext/lfs/__init__.py	Sat Jan 27 19:22:15 2018 -0500
@@ -360,10 +360,11 @@
 
 @templatekeyword('lfs_files')
 def lfsfiles(repo, ctx, **args):
-    """List of strings. LFS files added or modified by the changeset."""
+    """List of strings. All files modified, added, or removed by this
+    changeset."""
     args = pycompat.byteskwargs(args)
 
-    pointers = wrapper.pointersfromctx(ctx) # {path: pointer}
+    pointers = wrapper.pointersfromctx(ctx, removed=True) # {path: pointer}
     files = sorted(pointers.keys())
 
     def pointer(v):
@@ -374,7 +375,7 @@
 
     makemap = lambda v: {
         'file': v,
-        'lfsoid': pointers[v].oid(),
+        'lfsoid': pointers[v].oid() if pointers[v] else None,
         'lfspointer': templatekw.hybriddict(pointer(v)),
     }