mercurial/cmdutil.py
changeset 22190 55308ab8117c
parent 22189 cde6b489365c
child 22205 9fa429723f26
equal deleted inserted replaced
22189:cde6b489365c 22190:55308ab8117c
  2406             changes = repo.status(node1=parent, match=m)
  2406             changes = repo.status(node1=parent, match=m)
  2407             dsmodified = set(changes[0])
  2407             dsmodified = set(changes[0])
  2408             dsadded    = set(changes[1])
  2408             dsadded    = set(changes[1])
  2409             dsremoved  = set(changes[2])
  2409             dsremoved  = set(changes[2])
  2410             dsadded |= _deletedadded
  2410             dsadded |= _deletedadded
  2411             dsmodified |= _deletedmodified
       
  2412 
  2411 
  2413             # only take into account for removes between wc and target
  2412             # only take into account for removes between wc and target
  2414             clean |= dsremoved - removed
  2413             clean |= dsremoved - removed
  2415             dsremoved &= removed
  2414             dsremoved &= removed
  2416             # distinct between dirstate remove and other
  2415             # distinct between dirstate remove and other
  2417             removed -= dsremoved
  2416             removed -= dsremoved
       
  2417 
       
  2418             # tell newly modified apart.
       
  2419             dsmodified &= modified
       
  2420             dsmodified |= modified & dsadded # dirstate added may needs backup
       
  2421             modified -= dsmodified
  2418 
  2422 
  2419         # if f is a rename, update `names` to also revert the source
  2423         # if f is a rename, update `names` to also revert the source
  2420         cwd = repo.getcwd()
  2424         cwd = repo.getcwd()
  2421         for f in dsadded:
  2425         for f in dsadded:
  2422             src = repo.dirstate.copied(f)
  2426             src = repo.dirstate.copied(f)
  2446         disptable = (
  2450         disptable = (
  2447             # dispatch table:
  2451             # dispatch table:
  2448             #   file state
  2452             #   file state
  2449             #   action
  2453             #   action
  2450             #   make backup
  2454             #   make backup
       
  2455             (modified,         (actions['revert'],   False)),
  2451             (dsmodified,       (actions['revert'],   True)),
  2456             (dsmodified,       (actions['revert'],   True)),
  2452             (missingmodified,  (actions['remove'],   True)),
  2457             (missingmodified,  (actions['remove'],   True)),
  2453             (dsadded,          (actions['revert'],   True)),
  2458             (dsadded,          (actions['revert'],   True)),
  2454             (missingadded,     (actions['remove'],   False)),
  2459             (missingadded,     (actions['remove'],   False)),
  2455             (removed,          (actions['add'],      True)),
  2460             (removed,          (actions['add'],      True)),