comparison mercurial/commands.py @ 14399:71938479eff9

add new option --all to manifest command prints a list of all files in all revisions of the repo obsoletes the cifiles extension
author Adrian Buehlmann <adrian@cadifra.com>
date Wed, 18 May 2011 21:31:40 +0200
parents 2d16f15da7bd
children 90937dd4d94b
comparison
equal deleted inserted replaced
14398:ae1f7a5373e8 14399:71938479eff9
3390 if displayer.flush(ctx.rev()): 3390 if displayer.flush(ctx.rev()):
3391 count += 1 3391 count += 1
3392 displayer.close() 3392 displayer.close()
3393 3393
3394 @command('manifest', 3394 @command('manifest',
3395 [('r', 'rev', '', _('revision to display'), _('REV'))], 3395 [('r', 'rev', '', _('revision to display'), _('REV')),
3396 ('', 'all', False, _("list files from all revisions"))],
3396 _('[-r REV]')) 3397 _('[-r REV]'))
3397 def manifest(ui, repo, node=None, rev=None): 3398 def manifest(ui, repo, node=None, rev=None, **opts):
3398 """output the current or given revision of the project manifest 3399 """output the current or given revision of the project manifest
3399 3400
3400 Print a list of version controlled files for the given revision. 3401 Print a list of version controlled files for the given revision.
3401 If no revision is given, the first parent of the working directory 3402 If no revision is given, the first parent of the working directory
3402 is used, or the null revision if no revision is checked out. 3403 is used, or the null revision if no revision is checked out.
3403 3404
3404 With -v, print file permissions, symlink and executable bits. 3405 With -v, print file permissions, symlink and executable bits.
3405 With --debug, print file revision hashes. 3406 With --debug, print file revision hashes.
3406 3407
3408 If option --all is specified, the list of all files from all revisions
3409 is printed. This includes deleted and renamed files.
3410
3407 Returns 0 on success. 3411 Returns 0 on success.
3408 """ 3412 """
3413 if opts.get('all'):
3414 if rev or node:
3415 raise util.Abort(_("can't specify a revision with --all"))
3416
3417 res = []
3418 prefix = "data/"
3419 suffix = ".i"
3420 plen = len(prefix)
3421 slen = len(suffix)
3422 lock = repo.lock()
3423 try:
3424 for fn, b, size in repo.store.datafiles():
3425 if size != 0 and fn[-slen:] == suffix and fn[:plen] == prefix:
3426 res.append(fn[plen:-slen])
3427 finally:
3428 lock.release()
3429 for f in sorted(res):
3430 ui.write("%s\n" % f)
3431 return
3409 3432
3410 if rev and node: 3433 if rev and node:
3411 raise util.Abort(_("please specify just one revision")) 3434 raise util.Abort(_("please specify just one revision"))
3412 3435
3413 if not node: 3436 if not node: