On Fri, 09 Feb 2018 00:30:23 -0500, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbi...@yahoo.com>
> # Date 1517098935 18000
> #      Sat Jan 27 19:22:15 2018 -0500
> # Node ID e545487fa7fa9ff2fa4f85e2482bea8ba4040ef6
> # Parent  2b6579d78fe2dde40f8e0e99abeb35df93a4ade5
> lfs: teach '{lfs_files}' to handle removed files
> 
> diff --git a/hgext/lfs/__init__.py b/hgext/lfs/__init__.py
> --- a/hgext/lfs/__init__.py
> +++ b/hgext/lfs/__init__.py
> @@ -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())

> +{lfs_files} will list deleted files too
> +
> +  $ hg log -T "{lfs_files % '{rev} {file}: {lfspointer.oid}\n'}"
> +  6 lfs.test: 
> sha256:43f8f41171b6f62a6b61ba4ce98a8a6c1649240a47ebafd43120aa215ac9e7f6
> +  5 lfs.test: 
> sha256:43f8f41171b6f62a6b61ba4ce98a8a6c1649240a47ebafd43120aa215ac9e7f6
> +  3 lfs.catchall: 
> sha256:31f43b9c62b540126b0ad5884dc013d21a61c9329b77de1fceeae2fc58511573
> +  3 lfs.test: 
> sha256:8acd23467967bc7b8cc5a280056589b0ba0b17ff21dbd88a7b6474d6290378a6
> +  2 lfs.catchall: 
> sha256:d4ec46c2869ba22eceb42a729377432052d9dd75d82fc40390ebaadecee87ee9
> +  2 lfs.test: 
> sha256:5489e6ced8c36a7b267292bde9fd5242a5f80a7482e8f23fa0477393dfaa4d6c

Including removed files makes sense, but I think the pointer should be "null"
in which case because the file doesn't exist. I have no idea how the "null"
lfs pointer should look like, though.
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to