##// END OF EJS Templates
convert/svn: list files explicitely, stop checking their type...
Patrick Mezard -
r11132:321b8b2a default
parent child Browse files
Show More
@@ -649,10 +649,10 b' class svn_source(converter_source):'
649 elif fromkind == svn.core.svn_node_dir:
649 elif fromkind == svn.core.svn_node_dir:
650 oroot = parentpath.strip('/')
650 oroot = parentpath.strip('/')
651 nroot = path.strip('/')
651 nroot = path.strip('/')
652 children = self._find_children(oroot, prevnum)
652 children = self._listfiles(oroot, prevnum)
653 children = [s.replace(oroot, nroot) for s in children]
653 for childpath in children:
654 for child in children:
654 childpath = childpath.replace(oroot, nroot)
655 childpath = self.getrelpath("/" + child, pmodule)
655 childpath = self.getrelpath("/" + childpath, pmodule)
656 if childpath:
656 if childpath:
657 removed.add(self.recode(childpath))
657 removed.add(self.recode(childpath))
658 else:
658 else:
@@ -671,18 +671,11 b' class svn_source(converter_source):'
671 if pkind == svn.core.svn_node_file:
671 if pkind == svn.core.svn_node_file:
672 removed.add(self.recode(entrypath))
672 removed.add(self.recode(entrypath))
673
673
674 children = sorted(self._find_children(path, revnum))
674 children = sorted(self._listfiles(path, revnum))
675 for child in children:
675 for childpath in children:
676 # Can we move a child directory and its
676 childpath = self.getrelpath("/" + childpath)
677 # parent in the same commit? (probably can). Could
677 if childpath:
678 # cause problems if instead of revnum -1,
678 changed.add(self.recode(childpath))
679 # we have to look in (copyfrom_path, revnum - 1)
680 entrypath = self.getrelpath("/" + child)
681 if entrypath:
682 # Need to filter out directories here...
683 kind = self._checkpath(entrypath, revnum)
684 if kind != svn.core.svn_node_dir:
685 changed.add(self.recode(entrypath))
686
679
687 # Handle directory copies
680 # Handle directory copies
688 if not ent.copyfrom_path or not parents:
681 if not ent.copyfrom_path or not parents:
@@ -697,15 +690,15 b' class svn_source(converter_source):'
697 continue
690 continue
698 self.ui.debug("mark %s came from %s:%d\n"
691 self.ui.debug("mark %s came from %s:%d\n"
699 % (path, copyfrompath, ent.copyfrom_rev))
692 % (path, copyfrompath, ent.copyfrom_rev))
700 children = self._find_children(ent.copyfrom_path, ent.copyfrom_rev)
693 children = self._listfiles(ent.copyfrom_path, ent.copyfrom_rev)
701 children.sort()
694 children.sort()
702 for child in children:
695 for childpath in children:
703 entrypath = self.getrelpath("/" + child, pmodule)
696 childpath = self.getrelpath("/" + childpath, pmodule)
704 if not entrypath:
697 if not childpath:
705 continue
698 continue
706 copytopath = path + entrypath[len(copyfrompath):]
699 copytopath = path + childpath[len(copyfrompath):]
707 copytopath = self.getrelpath(copytopath)
700 copytopath = self.getrelpath(copytopath)
708 copies[self.recode(copytopath)] = self.recode(entrypath)
701 copies[self.recode(copytopath)] = self.recode(childpath)
709
702
710 changed.update(removed)
703 changed.update(removed)
711 return (list(changed), removed, copies)
704 return (list(changed), removed, copies)
@@ -867,12 +860,14 b' class svn_source(converter_source):'
867 data = data[len(link_prefix):]
860 data = data[len(link_prefix):]
868 return data, mode
861 return data, mode
869
862
870 def _find_children(self, path, revnum):
863 def _listfiles(self, path, revnum):
864 """List all files in path at revnum, recursively."""
871 path = path.strip('/')
865 path = path.strip('/')
872 pool = Pool()
866 pool = Pool()
873 rpath = '/'.join([self.baseurl, urllib.quote(path)]).strip('/')
867 rpath = '/'.join([self.baseurl, urllib.quote(path)]).strip('/')
874 return ['%s/%s' % (path, x) for x in
868 entries = svn.client.ls(rpath, optrev(revnum), True, self.ctx, pool)
875 svn.client.ls(rpath, optrev(revnum), True, self.ctx, pool).keys()]
869 return [(path + '/' + p) for p, e in entries.iteritems()
870 if e.kind == svn.core.svn_node_file]
876
871
877 def getrelpath(self, path, module=None):
872 def getrelpath(self, path, module=None):
878 if module is None:
873 if module is None:
General Comments 0
You need to be logged in to leave comments. Login now