Changeset 1001 in tailor


Ignore:
Timestamp:
11/15/05 08:07:47 (8 years ago)
Author:
Brendan Cully <brendan@…>
Hash name:
20051115070747-0ae3a-12b6c6f21029519486fa155a5dbbbe344798815f
Message:

Fix mercurial source deletion detection

The original mercurial delete logic would find any unchanged file in a
changeset to be deleted. This horrible bug was mitigated by the fact that
I had forgotten to actually add DELETED changeset entries to the changeset.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vcpx/hglib.py

    r1000 r1001  
    101101                pms = {} 
    102102 
    103         # Every time we find a file in the current manifest, we pop it from the parents. 
    104         # Anything left over in parents is a deleted file. 
    105103        for f in files: 
    106104            e = ChangesetEntry(f) 
     
    113111                pms.pop(oldname[0]) 
    114112            else: 
    115                 try: 
    116                     del pms[f] 
     113                if pms.has_key(f): 
    117114                    e.action_kind = ChangesetEntry.UPDATED 
    118                 except KeyError: 
     115                else: 
    119116                    e.action_kind = ChangesetEntry.ADDED 
    120117 
    121118            entries.append(e) 
    122119 
    123         for df in pms.iterkeys(): 
     120        for df in [file for file in pms.iterkeys() if not manifest.has_key(file)]: 
    124121            e = ChangesetEntry(df) 
    125122            e.action_kind = ChangesetEntry.DELETED 
     123            entries.append(e) 
    126124 
    127125        from mercurial.node import hex 
Note: See TracChangeset for help on using the changeset viewer.