mercurial/cmdutil.py
changeset 30532 66b162fa3ffa
parent 30531 841092fd6b85
child 30534 c01033fb9864
equal deleted inserted replaced
30531:841092fd6b85 30532:66b162fa3ffa
  3165 
  3165 
  3166     def checkout(f):
  3166     def checkout(f):
  3167         fc = ctx[f]
  3167         fc = ctx[f]
  3168         repo.wwrite(f, fc.data(), fc.flags())
  3168         repo.wwrite(f, fc.data(), fc.flags())
  3169 
  3169 
       
  3170     def doremove(f):
       
  3171         try:
       
  3172             util.unlinkpath(repo.wjoin(f))
       
  3173         except OSError:
       
  3174             pass
       
  3175         repo.dirstate.remove(f)
       
  3176 
  3170     audit_path = pathutil.pathauditor(repo.root)
  3177     audit_path = pathutil.pathauditor(repo.root)
  3171     for f in actions['forget'][0]:
  3178     for f in actions['forget'][0]:
  3172         if interactive:
  3179         if interactive:
  3173             choice = repo.ui.promptchoice(
  3180             choice = repo.ui.promptchoice(
  3174                 _("forget added file %s (Yn)?$$ &Yes $$ &No") % f)
  3181                 _("forget added file %s (Yn)?$$ &Yes $$ &No") % f)
  3178                 excluded_files.append(repo.wjoin(f))
  3185                 excluded_files.append(repo.wjoin(f))
  3179         else:
  3186         else:
  3180             repo.dirstate.drop(f)
  3187             repo.dirstate.drop(f)
  3181     for f in actions['remove'][0]:
  3188     for f in actions['remove'][0]:
  3182         audit_path(f)
  3189         audit_path(f)
  3183         try:
  3190         if interactive:
  3184             util.unlinkpath(repo.wjoin(f))
  3191             choice = repo.ui.promptchoice(
  3185         except OSError:
  3192                 _("remove added file %s (Yn)?$$ &Yes $$ &No") % f)
  3186             pass
  3193             if choice == 0:
  3187         repo.dirstate.remove(f)
  3194                 doremove(f)
       
  3195             else:
       
  3196                 excluded_files.append(repo.wjoin(f))
       
  3197         else:
       
  3198             doremove(f)
  3188     for f in actions['drop'][0]:
  3199     for f in actions['drop'][0]:
  3189         audit_path(f)
  3200         audit_path(f)
  3190         repo.dirstate.remove(f)
  3201         repo.dirstate.remove(f)
  3191 
  3202 
  3192     normal = None
  3203     normal = None