##// END OF EJS Templates
lfs: teach the 'lfs()' fileset to handle removed files...
Matt Harbison -
r36018:91aac8e6 default
parent child Browse files
Show More
@@ -350,13 +350,13 b' def extsetup(ui):'
350 # when writing a bundle via "hg bundle" command, upload related LFS blobs
350 # when writing a bundle via "hg bundle" command, upload related LFS blobs
351 wrapfunction(bundle2, 'writenewbundle', wrapper.writenewbundle)
351 wrapfunction(bundle2, 'writenewbundle', wrapper.writenewbundle)
352
352
353 @filesetpredicate('lfs()')
353 @filesetpredicate('lfs()', callstatus=True)
354 def lfsfileset(mctx, x):
354 def lfsfileset(mctx, x):
355 """File that uses LFS storage."""
355 """File that uses LFS storage."""
356 # i18n: "lfs" is a keyword
356 # i18n: "lfs" is a keyword
357 fileset.getargs(x, 0, 0, _("lfs takes no arguments"))
357 fileset.getargs(x, 0, 0, _("lfs takes no arguments"))
358 return [f for f in mctx.subset
358 return [f for f in mctx.subset
359 if wrapper.pointerfromctx(mctx.ctx, f) is not None]
359 if wrapper.pointerfromctx(mctx.ctx, f, removed=True) is not None]
360
360
361 @templatekeyword('lfs_files')
361 @templatekeyword('lfs_files')
362 def lfsfiles(repo, ctx, **args):
362 def lfsfiles(repo, ctx, **args):
@@ -162,6 +162,11 b' enabled adds the lfs requirement'
162
162
163 $ hg mv large l
163 $ hg mv large l
164 $ hg mv small s
164 $ hg mv small s
165 $ hg status 'set:removed()'
166 R large
167 R small
168 $ hg status 'set:removed() & lfs()'
169 R large
165 $ hg commit -m 'renames'
170 $ hg commit -m 'renames'
166
171
167 $ hg files -r . 'set:copied()'
172 $ hg files -r . 'set:copied()'
@@ -169,6 +174,11 b' enabled adds the lfs requirement'
169 s
174 s
170 $ hg files -r . 'set:copied() & lfs()'
175 $ hg files -r . 'set:copied() & lfs()'
171 l
176 l
177 $ hg status --change . 'set:removed()'
178 R large
179 R small
180 $ hg status --change . 'set:removed() & lfs()'
181 R large
172
182
173 $ echo SHORT > l
183 $ echo SHORT > l
174 $ echo BECOME-LARGER-FROM-SHORTER > s
184 $ echo BECOME-LARGER-FROM-SHORTER > s
@@ -1042,11 +1052,11 b' The LFS policy stops when the .hglfs is '
1042 2 lfs.catchall: sha256:d4ec46c2869ba22eceb42a729377432052d9dd75d82fc40390ebaadecee87ee9
1052 2 lfs.catchall: sha256:d4ec46c2869ba22eceb42a729377432052d9dd75d82fc40390ebaadecee87ee9
1043 2 lfs.test: sha256:5489e6ced8c36a7b267292bde9fd5242a5f80a7482e8f23fa0477393dfaa4d6c
1053 2 lfs.test: sha256:5489e6ced8c36a7b267292bde9fd5242a5f80a7482e8f23fa0477393dfaa4d6c
1044
1054
1045 TODO: This should notice the deleted lfs files in rev 6
1046 $ hg log -r 'file("set:lfs()")' -T '{rev} {join(lfs_files, ", ")}\n'
1055 $ hg log -r 'file("set:lfs()")' -T '{rev} {join(lfs_files, ", ")}\n'
1047 2 lfs.catchall, lfs.test
1056 2 lfs.catchall, lfs.test
1048 3 lfs.catchall, lfs.test
1057 3 lfs.catchall, lfs.test
1049 5 lfs.test
1058 5 lfs.test
1059 6 lfs.test
1050
1060
1051 $ cd ..
1061 $ cd ..
1052
1062
General Comments 0
You need to be logged in to leave comments. Login now