diff options
author | Ian Clatworthy <ian.clatworthy@canonical.com> | 2009-02-17 21:49:37 +1000 |
---|---|---|
committer | Ian Clatworthy <ian.clatworthy@canonical.com> | 2009-02-17 21:49:37 +1000 |
commit | d4c7335714ad80b21c3854780fac27c2b348be2a (patch) | |
tree | 425519a00a2c1eff914c54f5c489deb7515c936c /processors | |
parent | 108ff7c3efaab85cac6d9ef658a8526dcb979c9e (diff) | |
download | bzr-fastimport-d4c7335714ad80b21c3854780fac27c2b348be2a.tar.gz |
rename and copy tests & tweaks
Diffstat (limited to 'processors')
-rw-r--r-- | processors/filter_processor.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/processors/filter_processor.py b/processors/filter_processor.py index 6d07088..58c8953 100644 --- a/processors/filter_processor.py +++ b/processors/filter_processor.py @@ -251,6 +251,7 @@ class FilterProcessor(processor.ImportProcessor): elif keep_old: # The file has been renamed to a non-interesting location. # Delete it! + old = self._adjust_for_new_root(old) return commands.FileDeleteCommand(old) elif keep_new: # The file has been renamed into an interesting location @@ -260,7 +261,7 @@ class FilterProcessor(processor.ImportProcessor): # remember all renames and a config file can be passed # into here ala fast-import? warning("cannot turn rename of %s into an add of %s yet" % - (old,new)) + (old, new)) return None def _convert_copy(self, fc): @@ -271,17 +272,17 @@ class FilterProcessor(processor.ImportProcessor): paths are inside or outside of the interesting locations. """ src = fc.src_path - dest = fc.new_path + dest = fc.dest_path keep_src = self._path_to_be_kept(src) keep_dest = self._path_to_be_kept(dest) if keep_src and keep_dest: - fc.src_path = self._adjust_for_dest_root(src) - fc.dest_path = self._adjust_for_dest_root(dest) + fc.src_path = self._adjust_for_new_root(src) + fc.dest_path = self._adjust_for_new_root(dest) return fc elif keep_src: # The file has been copied to a non-interesting location. - # Delete it! - return commands.FileDeleteCommand(src) + # Ignore it! + return None elif keep_dest: # The file has been copied into an interesting location # We really ought to add it but we don't currently buffer @@ -290,5 +291,5 @@ class FilterProcessor(processor.ImportProcessor): # remember all copies and a config file can be passed # into here ala fast-import? warning("cannot turn copy of %s into an add of %s yet" % - (src,dest)) + (src, dest)) return None |