##// END OF EJS Templates
lfs: convert '{lfs_files}' keyword to a hybrid list...
Matt Harbison -
r35675:8580e589 default
parent child Browse files
Show More
@@ -61,9 +61,11 b' from mercurial import ('
61 localrepo,
61 localrepo,
62 minifileset,
62 minifileset,
63 node,
63 node,
64 pycompat,
64 registrar,
65 registrar,
65 revlog,
66 revlog,
66 scmutil,
67 scmutil,
68 templatekw,
67 upgrade,
69 upgrade,
68 vfs as vfsmod,
70 vfs as vfsmod,
69 wireproto,
71 wireproto,
@@ -221,8 +223,18 b' def extsetup(ui):'
221 @templatekeyword('lfs_files')
223 @templatekeyword('lfs_files')
222 def lfsfiles(repo, ctx, **args):
224 def lfsfiles(repo, ctx, **args):
223 """List of strings. LFS files added or modified by the changeset."""
225 """List of strings. LFS files added or modified by the changeset."""
226 args = pycompat.byteskwargs(args)
227
224 pointers = wrapper.pointersfromctx(ctx) # {path: pointer}
228 pointers = wrapper.pointersfromctx(ctx) # {path: pointer}
225 return sorted(pointers.keys())
229 files = sorted(pointers.keys())
230
231 makemap = lambda v: {
232 'file': v,
233 }
234
235 # TODO: make the separator ', '?
236 f = templatekw._showlist('lfs_file', files, args)
237 return templatekw._hybrid(f, files, makemap, pycompat.identity)
226
238
227 @command('debuglfsupload',
239 @command('debuglfsupload',
228 [('r', 'rev', [], _('upload large files introduced by REV'))])
240 [('r', 'rev', [], _('upload large files introduced by REV'))])
@@ -859,6 +859,11 b" there's no 'lfs' destination repo requir"
859 oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
859 oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
860 size 29
860 size 29
861 x-is-binary 0
861 x-is-binary 0
862 $ hg --cwd convert_lfs log -r 'all()' -T '{rev}: {lfs_files % "{file}\n"}'
863 0: a1
864 1: a2
865 2: a2
866
862 $ grep 'lfs' convert_lfs/.hg/requires
867 $ grep 'lfs' convert_lfs/.hg/requires
863 lfs
868 lfs
864
869
General Comments 0
You need to be logged in to leave comments. Login now