comparison mercurial/cmdutil.py @ 24449:bab983bb6fd1

revert: define 'wctx' a little earlier and use it more
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 24 Mar 2015 13:56:51 -0700
parents 5b85a5bc5bbb
children 961790c35b4f
comparison
equal deleted inserted replaced
24448:55c449345b10 24449:bab983bb6fd1
2807 wlock = repo.wlock() 2807 wlock = repo.wlock()
2808 try: 2808 try:
2809 ## filling of the `names` mapping 2809 ## filling of the `names` mapping
2810 # walk dirstate to fill `names` 2810 # walk dirstate to fill `names`
2811 2811
2812 m = scmutil.match(repo[None], pats, opts) 2812 wctx = repo[None]
2813 m = scmutil.match(wctx, pats, opts)
2813 if not m.always() or node != parent: 2814 if not m.always() or node != parent:
2814 m.bad = lambda x, y: False 2815 m.bad = lambda x, y: False
2815 for abs in repo.walk(m): 2816 for abs in repo.walk(m):
2816 names[abs] = m.rel(abs), m.exact(abs) 2817 names[abs] = m.rel(abs), m.exact(abs)
2817 2818
3010 (clean, actions['noop'], discard), 3011 (clean, actions['noop'], discard),
3011 # Existing file, not tracked anywhere 3012 # Existing file, not tracked anywhere
3012 (unknown, actions['unknown'], discard), 3013 (unknown, actions['unknown'], discard),
3013 ) 3014 )
3014 3015
3015 wctx = repo[None]
3016 for abs, (rel, exact) in sorted(names.items()): 3016 for abs, (rel, exact) in sorted(names.items()):
3017 # target file to be touch on disk (relative to cwd) 3017 # target file to be touch on disk (relative to cwd)
3018 target = repo.wjoin(abs) 3018 target = repo.wjoin(abs)
3019 # search the entry in the dispatch table. 3019 # search the entry in the dispatch table.
3020 # if the file is in any of these sets, it was touched in the working 3020 # if the file is in any of these sets, it was touched in the working