comparison mercurial/cmdutil.py @ 24534:1925769b4ff8

log: prefer 'wctx' over 'pctx' for working context
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 18 Mar 2015 21:44:25 -0700
parents 914caae9a86a
children 6e73c66a6919
comparison
equal deleted inserted replaced
24533:888dcab69ca3 24534:1925769b4ff8
1916 opts['branch'] = [repo.lookupbranch(b) for b in opts['branch']] 1916 opts['branch'] = [repo.lookupbranch(b) for b in opts['branch']]
1917 # pats/include/exclude are passed to match.match() directly in 1917 # pats/include/exclude are passed to match.match() directly in
1918 # _matchfiles() revset but walkchangerevs() builds its matcher with 1918 # _matchfiles() revset but walkchangerevs() builds its matcher with
1919 # scmutil.match(). The difference is input pats are globbed on 1919 # scmutil.match(). The difference is input pats are globbed on
1920 # platforms without shell expansion (windows). 1920 # platforms without shell expansion (windows).
1921 pctx = repo[None] 1921 wctx = repo[None]
1922 match, pats = scmutil.matchandpats(pctx, pats, opts) 1922 match, pats = scmutil.matchandpats(wctx, pats, opts)
1923 slowpath = match.anypats() or (match.files() and opts.get('removed')) 1923 slowpath = match.anypats() or (match.files() and opts.get('removed'))
1924 if not slowpath: 1924 if not slowpath:
1925 for f in match.files(): 1925 for f in match.files():
1926 if follow and f not in pctx: 1926 if follow and f not in wctx:
1927 # If the file exists, it may be a directory, so let it 1927 # If the file exists, it may be a directory, so let it
1928 # take the slow path. 1928 # take the slow path.
1929 if os.path.exists(repo.wjoin(f)): 1929 if os.path.exists(repo.wjoin(f)):
1930 slowpath = True 1930 slowpath = True
1931 continue 1931 continue