Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/debugcommands.py @ 38845:b9162ea1b815
fileset: extract language processing part to new module (API)
I'll add a couple more functions that work on parsed tree.
% wc -l mercurial/fileset*.py
559 mercurial/fileset.py
135 mercurial/filesetlang.py
694 total
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 22 Jul 2018 15:50:45 +0900 |
parents | f0a574dbfae9 |
children | 96b2e66dfa74 |
comparison
equal
deleted
inserted
replaced
38844:d82c4d42b615 | 38845:b9162ea1b815 |
---|---|
46 encoding, | 46 encoding, |
47 error, | 47 error, |
48 exchange, | 48 exchange, |
49 extensions, | 49 extensions, |
50 filemerge, | 50 filemerge, |
51 fileset, | 51 filesetlang, |
52 formatter, | 52 formatter, |
53 hg, | 53 hg, |
54 httppeer, | 54 httppeer, |
55 localrepo, | 55 localrepo, |
56 lock as lockmod, | 56 lock as lockmod, |
914 for n in opts['show_stage']: | 914 for n in opts['show_stage']: |
915 if n not in stagenames: | 915 if n not in stagenames: |
916 raise error.Abort(_('invalid stage name: %s') % n) | 916 raise error.Abort(_('invalid stage name: %s') % n) |
917 showalways.update(opts['show_stage']) | 917 showalways.update(opts['show_stage']) |
918 | 918 |
919 tree = fileset.parse(expr) | 919 tree = filesetlang.parse(expr) |
920 for n, f in stages: | 920 for n, f in stages: |
921 tree = f(tree) | 921 tree = f(tree) |
922 if n in showalways: | 922 if n in showalways: |
923 if opts['show_stage'] or n != 'parsed': | 923 if opts['show_stage'] or n != 'parsed': |
924 ui.write(("* %s:\n") % n) | 924 ui.write(("* %s:\n") % n) |
925 ui.write(fileset.prettyformat(tree), "\n") | 925 ui.write(filesetlang.prettyformat(tree), "\n") |
926 | 926 |
927 files = set() | 927 files = set() |
928 if opts['all_files']: | 928 if opts['all_files']: |
929 for r in repo: | 929 for r in repo: |
930 c = repo[r] | 930 c = repo[r] |