686 copyfrompath = ent.copyfrom_path.decode(self.encoding) |
686 copyfrompath = ent.copyfrom_path.decode(self.encoding) |
687 copyfrompath = self.getrelpath(copyfrompath, pmodule) |
687 copyfrompath = self.getrelpath(copyfrompath, pmodule) |
688 if not copyfrompath: |
688 if not copyfrompath: |
689 continue |
689 continue |
690 copyfrom[path] = ent |
690 copyfrom[path] = ent |
691 self.ui.debug("mark %s came from %s:%d\n" |
691 self.ui.debug("mark %s came from %s:%d\n" |
692 % (path, copyfrompath, ent.copyfrom_rev)) |
692 % (path, copyfrompath, ent.copyfrom_rev)) |
693 children = self._find_children(ent.copyfrom_path, ent.copyfrom_rev) |
693 children = self._find_children(ent.copyfrom_path, ent.copyfrom_rev) |
694 children.sort() |
694 children.sort() |
695 for child in children: |
695 for child in children: |
696 entrypath = self.getrelpath("/" + child, pmodule) |
696 entrypath = self.getrelpath("/" + child, pmodule) |
736 orig_paths.sort() |
736 orig_paths.sort() |
737 root_paths = [(p,e) for p,e in orig_paths if self.module.startswith(p)] |
737 root_paths = [(p,e) for p,e in orig_paths if self.module.startswith(p)] |
738 if root_paths: |
738 if root_paths: |
739 path, ent = root_paths[-1] |
739 path, ent = root_paths[-1] |
740 if ent.copyfrom_path: |
740 if ent.copyfrom_path: |
741 # If dir was moved while one of its file was removed |
741 # If dir was moved while one of its file was removed |
742 # the log may look like: |
742 # the log may look like: |
743 # A /dir (from /dir:x) |
743 # A /dir (from /dir:x) |
744 # A /dir/a (from /dir/a:y) |
744 # A /dir/a (from /dir/a:y) |
745 # A /dir/b (from /dir/b:z) |
745 # A /dir/b (from /dir/b:z) |
746 # ... |
746 # ... |
747 # for all remaining children. |
747 # for all remaining children. |
748 # Let's take the highest child element from rev as source. |
748 # Let's take the highest child element from rev as source. |
749 copies = [(p,e) for p,e in orig_paths[:-1] |
749 copies = [(p,e) for p,e in orig_paths[:-1] |
750 if isdescendantof(ent.copyfrom_path, e.copyfrom_path)] |
750 if isdescendantof(ent.copyfrom_path, e.copyfrom_path)] |
751 fromrev = max([e.copyfrom_rev for p,e in copies] + [ent.copyfrom_rev]) |
751 fromrev = max([e.copyfrom_rev for p,e in copies] + [ent.copyfrom_rev]) |
752 branched = True |
752 branched = True |
753 newpath = ent.copyfrom_path + self.module[len(path):] |
753 newpath = ent.copyfrom_path + self.module[len(path):] |
754 # ent.copyfrom_rev may not be the actual last revision |
754 # ent.copyfrom_rev may not be the actual last revision |