Show More
@@ -649,10 +649,10 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._ |
|
652 | children = self._listfiles(oroot, prevnum) | |
653 |
|
|
653 | for childpath in children: | |
654 |
|
|
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 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._ |
|
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 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._ |
|
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 |
|
|
696 | childpath = self.getrelpath("/" + childpath, pmodule) | |
704 |
if not |
|
697 | if not childpath: | |
705 | continue |
|
698 | continue | |
706 |
copytopath = path + |
|
699 | copytopath = path + childpath[len(copyfrompath):] | |
707 | copytopath = self.getrelpath(copytopath) |
|
700 | copytopath = self.getrelpath(copytopath) | |
708 |
copies[self.recode(copytopath)] = self.recode( |
|
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 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 _ |
|
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