Changeset 1468 in tailor for vcpx/repository/darcs/source.py


Ignore:
Timestamp:
03/21/08 01:25:04 (5 years ago)
Author:
Miklos Vajna <vmiklos@…>
Hash name:
20080321002504-8c5d4-2714c0f975822a2e4ebbcd6d4996c9237027cd40
Message:

DarcsChangeset?.addEntry: fix optimization

in case the changeset is like "mv a a2; mkdir a; mv a2 a/b" disable an
optimization that would break the conversion

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vcpx/repository/darcs/source.py

    r1467 r1468  
    7373            for i,e in enumerate(self.entries): 
    7474                if e.action_kind == e.RENAMED and e.old_name == entry.name: 
     75                    # Unfortunately we have to check if the order if 
     76                    # messed up, in that case we should not do anything. 
     77                    # Example: mv a a2; mkdir a; mv a2 a/b 
     78                    skip = False 
     79                    for j in self.entries: 
     80                        if j.action_kind == j.RENAMED and j.name.startswith(dirname): 
     81                            skip = True 
     82                            break 
    7583                    # Luckily enough (since removes are the first entries 
    7684                    # in the list, that is) by anticipating the add we 
    7785                    # cure also the case below, when addition follows 
    7886                    # edit. 
    79                     e.action_kind = e.ADDED 
    80                     e.old_name = None 
    81                     return e 
     87                    if not skip: 
     88                        e.action_kind = e.ADDED 
     89                        e.old_name = None 
     90                        return e 
    8291 
    8392                # Assert also that add_dir events must preceeds any 
Note: See TracChangeset for help on using the changeset viewer.