Changeset 1049 in tailor


Ignore:
Timestamp:
12/27/05 14:48:34 (7 years ago)
Author:
lele@…
Hash name:
20051227134834-7a6fb-0c1213bff7d78f3a2dd872143faee3bc7aa55105
Message:

Do not add entries inside a moved/copied directory on bzr target
The fix to #24 and indirectly #23 triggered (actually, the test did) a
similar issue solved for Subversion with [840] and [841]. This patch
applies a similar solution for BazaarNG, to prevent addition within a
renamed/copied directory. Specifically, this may happen for example
in a changeset coming from Svn that

  1. copies a directory
  2. replaces (a Subversion "R" event) an item in the target with something else
File:
1 edited

Legend:

Unmodified
Added
Removed
  • vcpx/bzr.py

    r1046 r1049  
    137137            added = ([new[0] for new in diff.added] + 
    138138                     [renamed[1] for renamed in diff.renamed]) 
     139 
     140            def parent_was_copied(n): 
     141                for p in added: 
     142                    if n.startswith(p+'/'): 
     143                        return True 
     144                return False 
     145 
    139146            for e in entries: 
    140                 if not inv.has_filename(e) and not e in added: 
    141                     new_entries.extend([e]) 
     147                if (not inv.has_filename(e) 
     148                    and not e in added 
     149                    and not parent_was_copied(e)): 
     150                    new_entries.append(e) 
    142151                else: 
    143152                    self.log.debug('"%s" already in inventory, skipping', e) 
Note: See TracChangeset for help on using the changeset viewer.