##// END OF EJS Templates
lfs: teach '{lfs_files}' to handle removed files
Matt Harbison -
r36017:8c7d5e90 default
parent child Browse files
Show More
@@ -360,10 +360,11 b' def lfsfileset(mctx, x):'
360
360
361 @templatekeyword('lfs_files')
361 @templatekeyword('lfs_files')
362 def lfsfiles(repo, ctx, **args):
362 def lfsfiles(repo, ctx, **args):
363 """List of strings. LFS files added or modified by the changeset."""
363 """List of strings. All files modified, added, or removed by this
364 changeset."""
364 args = pycompat.byteskwargs(args)
365 args = pycompat.byteskwargs(args)
365
366
366 pointers = wrapper.pointersfromctx(ctx) # {path: pointer}
367 pointers = wrapper.pointersfromctx(ctx, removed=True) # {path: pointer}
367 files = sorted(pointers.keys())
368 files = sorted(pointers.keys())
368
369
369 def pointer(v):
370 def pointer(v):
@@ -374,7 +375,7 b' def lfsfiles(repo, ctx, **args):'
374
375
375 makemap = lambda v: {
376 makemap = lambda v: {
376 'file': v,
377 'file': v,
377 'lfsoid': pointers[v].oid(),
378 'lfsoid': pointers[v].oid() if pointers[v] else None,
378 'lfspointer': templatekw.hybriddict(pointer(v)),
379 'lfspointer': templatekw.hybriddict(pointer(v)),
379 }
380 }
380
381
@@ -298,7 +298,7 b' locally.'
298 $TESTTMP/nolargefiles/.hg/hgrc:*: extensions.lfs= (glob)
298 $TESTTMP/nolargefiles/.hg/hgrc:*: extensions.lfs= (glob)
299
299
300 $ hg log -r 'all()' -G -T '{rev} {join(lfs_files, ", ")} ({desc})\n'
300 $ hg log -r 'all()' -G -T '{rev} {join(lfs_files, ", ")} ({desc})\n'
301 o 8 (remove large_by_size.bin)
301 o 8 large_by_size.bin (remove large_by_size.bin)
302 |
302 |
303 o 7 large_by_size.bin (large by size)
303 o 7 large_by_size.bin (large by size)
304 |
304 |
@@ -186,7 +186,7 b' enabled adds the lfs requirement'
186
186
187 $ hg log -r 'all()' -T '{rev} {join(lfs_files, ", ")}\n'
187 $ hg log -r 'all()' -T '{rev} {join(lfs_files, ", ")}\n'
188 0 large
188 0 large
189 1 l
189 1 l, large
190 2 s
190 2 s
191 3 s
191 3 s
192 4 l
192 4 l
@@ -1032,6 +1032,16 b' The LFS policy stops when the .hglfs is '
1032 $ hg rm lfs.test
1032 $ hg rm lfs.test
1033 $ hg ci -qm 'remove lfs'
1033 $ hg ci -qm 'remove lfs'
1034
1034
1035 {lfs_files} will list deleted files too
1036
1037 $ hg log -T "{lfs_files % '{rev} {file}: {lfspointer.oid}\n'}"
1038 6 lfs.test:
1039 5 lfs.test: sha256:43f8f41171b6f62a6b61ba4ce98a8a6c1649240a47ebafd43120aa215ac9e7f6
1040 3 lfs.catchall: sha256:31f43b9c62b540126b0ad5884dc013d21a61c9329b77de1fceeae2fc58511573
1041 3 lfs.test: sha256:8acd23467967bc7b8cc5a280056589b0ba0b17ff21dbd88a7b6474d6290378a6
1042 2 lfs.catchall: sha256:d4ec46c2869ba22eceb42a729377432052d9dd75d82fc40390ebaadecee87ee9
1043 2 lfs.test: sha256:5489e6ced8c36a7b267292bde9fd5242a5f80a7482e8f23fa0477393dfaa4d6c
1044
1035 TODO: This should notice the deleted lfs files in rev 6
1045 TODO: This should notice the deleted lfs files in rev 6
1036 $ hg log -r 'file("set:lfs()")' -T '{rev} {join(lfs_files, ", ")}\n'
1046 $ hg log -r 'file("set:lfs()")' -T '{rev} {join(lfs_files, ", ")}\n'
1037 2 lfs.catchall, lfs.test
1047 2 lfs.catchall, lfs.test
General Comments 0
You need to be logged in to leave comments. Login now