mercurial/commands.py
changeset 27176 54ace3372f84
parent 27173 8a8f5d71a49a
child 27192 a01d3d32b53a
equal deleted inserted replaced
27175:25a8a866eb5d 27176:54ace3372f84
  2963     """
  2963     """
  2964     ctx = scmutil.revsingle(repo, rev)
  2964     ctx = scmutil.revsingle(repo, rev)
  2965     wlock = repo.wlock()
  2965     wlock = repo.wlock()
  2966     try:
  2966     try:
  2967         dirstate = repo.dirstate
  2967         dirstate = repo.dirstate
  2968 
  2968         changedfiles = None
  2969         # See command doc for what minimal does.
  2969         # See command doc for what minimal does.
  2970         if opts.get('minimal'):
  2970         if opts.get('minimal'):
       
  2971             manifestfiles = set(ctx.manifest().keys())
  2971             dirstatefiles = set(dirstate)
  2972             dirstatefiles = set(dirstate)
  2972             ctxfiles = set(ctx.manifest().keys())
  2973             manifestonly = manifestfiles - dirstatefiles
  2973             for file in (dirstatefiles | ctxfiles):
  2974             dsonly = dirstatefiles - manifestfiles
  2974                 indirstate = file in dirstatefiles
  2975             dsnotadded = set(f for f in dsonly if dirstate[f] != 'a')
  2975                 inctx = file in ctxfiles
  2976             changedfiles =  manifestonly | dsnotadded
  2976 
  2977 
  2977                 if indirstate and not inctx and dirstate[file] != 'a':
  2978         dirstate.rebuild(ctx.node(), ctx.manifest(), changedfiles)
  2978                     dirstate.drop(file)
       
  2979                 elif inctx and not indirstate:
       
  2980                     dirstate.normallookup(file)
       
  2981         else:
       
  2982             dirstate.rebuild(ctx.node(), ctx.manifest())
       
  2983     finally:
  2979     finally:
  2984         wlock.release()
  2980         wlock.release()
  2985 
  2981 
  2986 @command('debugrebuildfncache', [], '')
  2982 @command('debugrebuildfncache', [], '')
  2987 def debugrebuildfncache(ui, repo):
  2983 def debugrebuildfncache(ui, repo):