comparison mercurial/commands.py @ 31040:bcc9d4ebf81b

manifest: enable pager
author Augie Fackler <augie@google.com>
date Mon, 06 Feb 2017 23:04:26 -0500
parents 9f28424d6483
children 77a252f2544d
comparison
equal deleted inserted replaced
31039:9f28424d6483 31040:bcc9d4ebf81b
3482 If option --all is specified, the list of all files from all revisions 3482 If option --all is specified, the list of all files from all revisions
3483 is printed. This includes deleted and renamed files. 3483 is printed. This includes deleted and renamed files.
3484 3484
3485 Returns 0 on success. 3485 Returns 0 on success.
3486 """ 3486 """
3487
3488 fm = ui.formatter('manifest', opts) 3487 fm = ui.formatter('manifest', opts)
3489 3488
3490 if opts.get('all'): 3489 if opts.get('all'):
3491 if rev or node: 3490 if rev or node:
3492 raise error.Abort(_("can't specify a revision with --all")) 3491 raise error.Abort(_("can't specify a revision with --all"))
3498 slen = len(suffix) 3497 slen = len(suffix)
3499 with repo.lock(): 3498 with repo.lock():
3500 for fn, b, size in repo.store.datafiles(): 3499 for fn, b, size in repo.store.datafiles():
3501 if size != 0 and fn[-slen:] == suffix and fn[:plen] == prefix: 3500 if size != 0 and fn[-slen:] == suffix and fn[:plen] == prefix:
3502 res.append(fn[plen:-slen]) 3501 res.append(fn[plen:-slen])
3502 ui.pager('manifest')
3503 for f in res: 3503 for f in res:
3504 fm.startitem() 3504 fm.startitem()
3505 fm.write("path", '%s\n', f) 3505 fm.write("path", '%s\n', f)
3506 fm.end() 3506 fm.end()
3507 return 3507 return
3514 3514
3515 char = {'l': '@', 'x': '*', '': ''} 3515 char = {'l': '@', 'x': '*', '': ''}
3516 mode = {'l': '644', 'x': '755', '': '644'} 3516 mode = {'l': '644', 'x': '755', '': '644'}
3517 ctx = scmutil.revsingle(repo, node) 3517 ctx = scmutil.revsingle(repo, node)
3518 mf = ctx.manifest() 3518 mf = ctx.manifest()
3519 ui.pager('manifest')
3519 for f in ctx: 3520 for f in ctx:
3520 fm.startitem() 3521 fm.startitem()
3521 fl = ctx[f].flags() 3522 fl = ctx[f].flags()
3522 fm.condwrite(ui.debugflag, 'hash', '%s ', hex(mf[f])) 3523 fm.condwrite(ui.debugflag, 'hash', '%s ', hex(mf[f]))
3523 fm.condwrite(ui.verbose, 'mode type', '%s %1s ', mode[fl], char[fl]) 3524 fm.condwrite(ui.verbose, 'mode type', '%s %1s ', mode[fl], char[fl])