comparison hgext/convert/subversion.py @ 13052:5fb924ee44d5 stable

convert/svn: fix changed files list upon directory replacements When branch2/dir was replacing branch1/dir, we only marked branch2/dir files a changed. Add branch1/dir files as they may not exist in branch2.
author Patrick Mezard <pmezard@gmail.com>
date Mon, 29 Nov 2010 20:13:11 +0100
parents 614f0d8724ab
children 5314cbb775f6
comparison
equal deleted inserted replaced
13044:db1433e4bf5f 13052:5fb924ee44d5
654 elif kind == svn.core.svn_node_dir: 654 elif kind == svn.core.svn_node_dir:
655 if ent.action == 'M': 655 if ent.action == 'M':
656 # If the directory just had a prop change, 656 # If the directory just had a prop change,
657 # then we shouldn't need to look for its children. 657 # then we shouldn't need to look for its children.
658 continue 658 continue
659 elif ent.action == 'R' and parents: 659 if ent.action == 'R' and parents:
660 # If a directory is replacing a file, mark the previous 660 # If a directory is replacing a file, mark the previous
661 # file as deleted 661 # file as deleted
662 pmodule, prevnum = self.revsplit(parents[0])[1:] 662 pmodule, prevnum = self.revsplit(parents[0])[1:]
663 pkind = self._checkpath(entrypath, prevnum, pmodule) 663 pkind = self._checkpath(entrypath, prevnum, pmodule)
664 if pkind == svn.core.svn_node_file: 664 if pkind == svn.core.svn_node_file:
665 removed.add(self.recode(entrypath)) 665 removed.add(self.recode(entrypath))
666 elif pkind == svn.core.svn_node_dir:
667 # We do not know what files were kept or removed,
668 # mark them all as changed.
669 for childpath in self._iterfiles(pmodule, prevnum):
670 childpath = self.getrelpath("/" + childpath)
671 if childpath:
672 changed.add(self.recode(childpath))
666 673
667 for childpath in self._iterfiles(path, revnum): 674 for childpath in self._iterfiles(path, revnum):
668 childpath = self.getrelpath("/" + childpath) 675 childpath = self.getrelpath("/" + childpath)
669 if childpath: 676 if childpath:
670 changed.add(self.recode(childpath)) 677 changed.add(self.recode(childpath))