comparison mercurial/cmdutil.py @ 22610:0f323ed8effd

revert: track added files with local modifications Those files need to be backed up but are currently not. We compute the set of them to be able to use a different backup strategy in the next changeset.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Sat, 30 Aug 2014 02:39:08 +0200
parents 3760ebf786b8
children 2ff28e07d7d6
comparison
equal deleted inserted replaced
22609:3760ebf786b8 22610:0f323ed8effd
2522 removed = set(changes[2]) 2522 removed = set(changes[2])
2523 _deleted = set(changes[3]) 2523 _deleted = set(changes[3])
2524 unknown = set(changes[4]) 2524 unknown = set(changes[4])
2525 unknown.update(changes[5]) 2525 unknown.update(changes[5])
2526 clean = set(changes[6]) 2526 clean = set(changes[6])
2527 modadded = set()
2527 2528
2528 # split between files known in target manifest and the others 2529 # split between files known in target manifest and the others
2529 smf = set(mf) 2530 smf = set(mf)
2530 2531
2531 # determine the exact nature of the deleted changesets 2532 # determine the exact nature of the deleted changesets
2552 clean |= dsremoved - removed 2553 clean |= dsremoved - removed
2553 dsremoved &= removed 2554 dsremoved &= removed
2554 # distinct between dirstate remove and other 2555 # distinct between dirstate remove and other
2555 removed -= dsremoved 2556 removed -= dsremoved
2556 2557
2558 modadded = added & dsmodified
2559 added -= modadded
2560
2557 # tell newly modified apart. 2561 # tell newly modified apart.
2558 dsmodified &= modified 2562 dsmodified &= modified
2559 dsmodified |= modified & dsadded # dirstate added may needs backup 2563 dsmodified |= modified & dsadded # dirstate added may needs backup
2560 modified -= dsmodified 2564 modified -= dsmodified
2561 2565
2651 (dsmodified, actions['revert'], backup), 2655 (dsmodified, actions['revert'], backup),
2652 # Added since target 2656 # Added since target
2653 (added, actions['remove'], discard), 2657 (added, actions['remove'], discard),
2654 # Added in working directory 2658 # Added in working directory
2655 (dsadded, actions['forget'], discard), 2659 (dsadded, actions['forget'], discard),
2660 # Added since target, have local modification
2661 (modadded, actions['remove'], discard),
2656 # Added since target but file is missing in working directory 2662 # Added since target but file is missing in working directory
2657 (deladded, actions['drop'], discard), 2663 (deladded, actions['drop'], discard),
2658 # Removed since target, before working copy parent 2664 # Removed since target, before working copy parent
2659 (removed, actions['add'], discard), 2665 (removed, actions['add'], discard),
2660 # Same as `removed` but an unknown file exists at the same path 2666 # Same as `removed` but an unknown file exists at the same path