mercurial/commands.py
changeset 27806 a5eae47aa1f8
parent 27805 bdaf433192f0
child 27807 6ad5e134ef2e
equal deleted inserted replaced
27805:bdaf433192f0 27806:a5eae47aa1f8
  3122 
  3122 
  3123     One use of this command is to make the next :hg:`status` invocation
  3123     One use of this command is to make the next :hg:`status` invocation
  3124     check the actual file content.
  3124     check the actual file content.
  3125     """
  3125     """
  3126     ctx = scmutil.revsingle(repo, rev)
  3126     ctx = scmutil.revsingle(repo, rev)
  3127     wlock = repo.wlock()
  3127     with repo.wlock():
  3128     try:
       
  3129         dirstate = repo.dirstate
  3128         dirstate = repo.dirstate
  3130         changedfiles = None
  3129         changedfiles = None
  3131         # See command doc for what minimal does.
  3130         # See command doc for what minimal does.
  3132         if opts.get('minimal'):
  3131         if opts.get('minimal'):
  3133             manifestfiles = set(ctx.manifest().keys())
  3132             manifestfiles = set(ctx.manifest().keys())
  3136             dsonly = dirstatefiles - manifestfiles
  3135             dsonly = dirstatefiles - manifestfiles
  3137             dsnotadded = set(f for f in dsonly if dirstate[f] != 'a')
  3136             dsnotadded = set(f for f in dsonly if dirstate[f] != 'a')
  3138             changedfiles = manifestonly | dsnotadded
  3137             changedfiles = manifestonly | dsnotadded
  3139 
  3138 
  3140         dirstate.rebuild(ctx.node(), ctx.manifest(), changedfiles)
  3139         dirstate.rebuild(ctx.node(), ctx.manifest(), changedfiles)
  3141     finally:
       
  3142         wlock.release()
       
  3143 
  3140 
  3144 @command('debugrebuildfncache', [], '')
  3141 @command('debugrebuildfncache', [], '')
  3145 def debugrebuildfncache(ui, repo):
  3142 def debugrebuildfncache(ui, repo):
  3146     """rebuild the fncache file"""
  3143     """rebuild the fncache file"""
  3147     repair.rebuildfncache(ui, repo)
  3144     repair.rebuildfncache(ui, repo)