comparison hgext/convert/subversion.py @ 8885:2c184bd2b37a

convert/svn: remove confusing unicode variable
author Patrick Mezard <pmezard@gmail.com>
date Sun, 21 Jun 2009 23:04:02 +0200
parents 8b603c7c808e
children 0593c5b5b1f0
comparison
equal deleted inserted replaced
8884:8b603c7c808e 8885:2c184bd2b37a
622 self.module = new_module 622 self.module = new_module
623 self.reparent(self.module) 623 self.reparent(self.module)
624 624
625 for path, ent in paths: 625 for path, ent in paths:
626 entrypath = self.getrelpath(path) 626 entrypath = self.getrelpath(path)
627 entry = entrypath.decode(self.encoding)
628 627
629 kind = self._checkpath(entrypath, revnum) 628 kind = self._checkpath(entrypath, revnum)
630 if kind == svn.core.svn_node_file: 629 if kind == svn.core.svn_node_file:
631 entries.append(self.recode(entry)) 630 entries.append(self.recode(entrypath))
632 if not ent.copyfrom_path or not parents: 631 if not ent.copyfrom_path or not parents:
633 continue 632 continue
634 # Copy sources not in parent revisions cannot be 633 # Copy sources not in parent revisions cannot be
635 # represented, ignore their origin for now 634 # represented, ignore their origin for now
636 pmodule, prevnum = self.revsplit(parents[0])[1:] 635 pmodule, prevnum = self.revsplit(parents[0])[1:]
639 copyfrom_path = self.getrelpath(ent.copyfrom_path, pmodule) 638 copyfrom_path = self.getrelpath(ent.copyfrom_path, pmodule)
640 if not copyfrom_path: 639 if not copyfrom_path:
641 continue 640 continue
642 self.ui.debug(_("copied to %s from %s@%s\n") % 641 self.ui.debug(_("copied to %s from %s@%s\n") %
643 (entrypath, copyfrom_path, ent.copyfrom_rev)) 642 (entrypath, copyfrom_path, ent.copyfrom_rev))
644 copies[self.recode(entry)] = self.recode(copyfrom_path) 643 copies[self.recode(entrypath)] = self.recode(copyfrom_path)
645 elif kind == 0: # gone, but had better be a deleted *file* 644 elif kind == 0: # gone, but had better be a deleted *file*
646 self.ui.debug(_("gone from %s\n") % ent.copyfrom_rev) 645 self.ui.debug(_("gone from %s\n") % ent.copyfrom_rev)
647 pmodule, prevnum = self.revsplit(parents[0])[1:] 646 pmodule, prevnum = self.revsplit(parents[0])[1:]
648 parentpath = pmodule + "/" + entrypath 647 parentpath = pmodule + "/" + entrypath
649 self.ui.debug(_("entry %s\n") % parentpath) 648 self.ui.debug(_("entry %s\n") % parentpath)
653 prevmodule = self.reparent('') 652 prevmodule = self.reparent('')
654 fromkind = svn.ra.check_path(self.ra, parentpath.strip('/'), prevnum) 653 fromkind = svn.ra.check_path(self.ra, parentpath.strip('/'), prevnum)
655 self.reparent(prevmodule) 654 self.reparent(prevmodule)
656 655
657 if fromkind == svn.core.svn_node_file: 656 if fromkind == svn.core.svn_node_file:
658 entries.append(self.recode(entry)) 657 entries.append(self.recode(entrypath))
659 elif fromkind == svn.core.svn_node_dir: 658 elif fromkind == svn.core.svn_node_dir:
660 if ent.action == 'C': 659 if ent.action == 'C':
661 children = self._find_children(path, prevnum) 660 children = self._find_children(path, prevnum)
662 else: 661 else:
663 oroot = parentpath.strip('/') 662 oroot = parentpath.strip('/')