mercurial/commands.py
changeset 6106 cb2f7652ad1b
parent 6094 3998c1b0828f
child 6107 41bb88cb913e
equal deleted inserted replaced
6105:6480af8fd53c 6106:cb2f7652ad1b
  2209     names = {}
  2209     names = {}
  2210 
  2210 
  2211     wlock = repo.wlock()
  2211     wlock = repo.wlock()
  2212     try:
  2212     try:
  2213         # walk dirstate.
  2213         # walk dirstate.
       
  2214         files = []
  2214         for src, abs, rel, exact in cmdutil.walk(repo, pats, opts,
  2215         for src, abs, rel, exact in cmdutil.walk(repo, pats, opts,
  2215                                                  badmatch=mf.has_key):
  2216                                                  badmatch=mf.has_key):
  2216             names[abs] = (rel, exact)
  2217             names[abs] = (rel, exact)
       
  2218             if src != 'b':
       
  2219                 files.append(abs)
  2217 
  2220 
  2218         # walk target manifest.
  2221         # walk target manifest.
  2219 
  2222 
  2220         def badmatch(path):
  2223         def badmatch(path):
  2221             if path in names:
  2224             if path in names:
  2230                                                  badmatch=badmatch):
  2233                                                  badmatch=badmatch):
  2231             if abs in names or src == 'b':
  2234             if abs in names or src == 'b':
  2232                 continue
  2235                 continue
  2233             names[abs] = (rel, exact)
  2236             names[abs] = (rel, exact)
  2234 
  2237 
  2235         changes = repo.status(match=names.has_key)[:4]
  2238         changes = repo.status(files=files, match=names.has_key)[:4]
  2236         modified, added, removed, deleted = map(dict.fromkeys, changes)
  2239         modified, added, removed, deleted = map(dict.fromkeys, changes)
  2237 
  2240 
  2238         # if f is a rename, also revert the source
  2241         # if f is a rename, also revert the source
  2239         cwd = repo.getcwd()
  2242         cwd = repo.getcwd()
  2240         for f in added:
  2243         for f in added: