##// END OF EJS Templates
debugfileset: implement --rev, more tests
Patrick Mezard -
r17370:3fe19957 stable
parent child Browse files
Show More
@@ -1847,14 +1847,17 b' def debugdiscovery(ui, repo, remoteurl="'
1847 1847 localrevs = opts.get('local_head')
1848 1848 doit(localrevs, remoterevs)
1849 1849
1850 @command('debugfileset', [], ('REVSPEC'))
1851 def debugfileset(ui, repo, expr):
1850 @command('debugfileset',
1851 [('r', 'rev', '', _('apply the filespec on this revision'), _('REV'))],
1852 _('[-r REV] FILESPEC'))
1853 def debugfileset(ui, repo, expr, **opts):
1852 1854 '''parse and apply a fileset specification'''
1855 ctx = scmutil.revsingle(repo, opts.get('rev'), None)
1853 1856 if ui.verbose:
1854 1857 tree = fileset.parse(expr)[0]
1855 1858 ui.note(tree, "\n")
1856 1859
1857 for f in fileset.getfileset(repo[None], expr):
1860 for f in fileset.getfileset(ctx, expr):
1858 1861 ui.write("%s\n" % f)
1859 1862
1860 1863 @command('debugfsinfo', [], _('[PATH]'))
@@ -229,7 +229,7 b' Show all commands + options'
229 229 debugdata: changelog, manifest
230 230 debugdate: extended
231 231 debugdiscovery: old, nonheads, ssh, remotecmd, insecure
232 debugfileset:
232 debugfileset: rev
233 233 debugfsinfo:
234 234 debuggetbundle: head, common, type
235 235 debugignore:
@@ -173,4 +173,53 b' Test subrepo predicate'
173 173 sub
174 174 $ fileset 'subrepo("glob:*")'
175 175 sub
176 $ hg ci -m subrepo
176 177
178 Test with a revision
179
180 $ hg log -G --template '{rev} {desc}\n'
181 @ 4 subrepo
182 |
183 o 3 merge
184 |\
185 | o 2 diverging
186 | |
187 o | 1 manychanges
188 |/
189 o 0 addfiles
190
191 $ echo unknown > unknown
192 $ fileset -r1 'modified()'
193 b2
194 $ fileset -r1 'added() and c1'
195 c1
196 $ fileset -r1 'removed()'
197 a2
198 $ fileset -r1 'deleted()'
199 $ fileset -r1 'unknown()'
200 $ fileset -r1 'ignored()'
201 $ fileset -r1 'hgignore()'
202 b2
203 bin
204 $ fileset -r1 'binary()'
205 bin
206 $ fileset -r1 'size(1k)'
207 1k
208 $ fileset -r3 'resolved()'
209 $ fileset -r3 'unresolved()'
210
211 #if execbit
212 $ fileset -r1 'exec()'
213 b2
214 #endif
215
216 #if symlink
217 $ fileset -r1 'symlink()'
218 b2link
219 #endif
220
221 $ fileset -r4 'subrepo("re:su.*")'
222 sub
223 $ fileset -r4 'subrepo("sub")'
224 sub
225
General Comments 0
You need to be logged in to leave comments. Login now