Index: tracext/hg/backend.py
|
|
|
|
| 610 | 610 | for rev in xrange(n_rev, -1, -1): |
| 611 | 611 | for f in self.repos.repo.changectx(rev).files(): |
| 612 | 612 | for d in dirnames[:]: |
| 613 | | if f.startswith(d): |
| | 613 | if unicode(f,'latin-1').startswith(d): |
| 614 | 614 | dirnodes[d] = log.node(rev) |
| 615 | 615 | dirnames.remove(d) |
| 616 | 616 | if not dirnames: # if nothing left to find |
| … |
… |
|
| 633 | 633 | entries = {} |
| 634 | 634 | for file in self.manifest.keys(): |
| 635 | 635 | if file.startswith(dir): |
| 636 | | entry = file[len(dir):].split('/', 1)[0] |
| | 636 | entry = unicode(file[len(dir):].split('/', 1)[0], 'latin-1') |
| 637 | 637 | entries[entry] = 1 |
| 638 | 638 | if entries: |
| 639 | 639 | kind = Node.DIRECTORY |
| … |
… |
|
| 657 | 657 | self.time = self.repos.hg_time(log.read(node)[2]) |
| 658 | 658 | rev = self.repos.hg_display(node) |
| 659 | 659 | Node.__init__(self, path, rev, kind) |
| 660 | | self.created_path = path |
| | 660 | self.created_path = unicode(path, 'latin-1') |
| 661 | 661 | self.created_rev = rev |
| 662 | 662 | self.node = node |
| 663 | 663 | self.data = None |
| … |
… |
|
| 885 | 885 | renames = {} |
| 886 | 886 | changes = [] |
| 887 | 887 | for f in self.files: # 'added' and 'edited' files |
| | 888 | f2 = unicode(f, 'latin-1') |
| 888 | 889 | if f in deletions: # and since Mercurial > 0.7 [hg c6ffedc4f11b] |
| 889 | 890 | continue # also 'deleted' files |
| 890 | 891 | action = None |
| 891 | 892 | # TODO: find a way to detect conflicts and show how they were solved |
| 892 | 893 | if manifest1 and f in manifest1: |
| 893 | 894 | action = Changeset.EDIT |
| 894 | | changes.append((f, Node.FILE, action, f, self.parents[0])) |
| | 895 | changes.append((f2, Node.FILE, action, f, self.parents[0])) |
| 895 | 896 | if manifest2 and f in manifest2: |
| 896 | 897 | action = Changeset.EDIT |
| 897 | | changes.append((f, Node.FILE, action, f, self.parents[1])) |
| | 898 | changes.append((f2, Node.FILE, action, f, self.parents[1])) |
| 898 | 899 | |
| 899 | 900 | if not action: |
| 900 | 901 | rename_info = repo.file(f).renamed(manifest[f]) |
| … |
… |
|
| 911 | 912 | action = Changeset.ADD |
| 912 | 913 | base_path = '' |
| 913 | 914 | base_rev = None |
| 914 | | changes.append((f, Node.FILE, action, base_path, base_rev)) |
| | 915 | changes.append((f2, Node.FILE, action, base_path, base_rev)) |
| 915 | 916 | |
| 916 | 917 | for f, p in deletions.items(): |
| | 918 | f2 = unicode(f, 'latin-1') |
| 917 | 919 | if f not in renames: |
| 918 | | changes.append((f, Node.FILE, Changeset.DELETE, f, p)) |
| | 920 | changes.append((f2, Node.FILE, Changeset.DELETE, f, p)) |
| 919 | 921 | changes.sort() |
| 920 | 922 | for change in changes: |
| 921 | 923 | yield change |