Changeset 8332
- Timestamp:
- Jun 28, 2009, 4:36:25 PM (15 years ago)
- Location:
- branches/0.11-stable/trac/versioncontrol
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/0.11-stable/trac/versioncontrol/svn_fs.py
r8310 r8332 787 787 self.pool()) 788 788 789 def get_copy_origin(self): 790 root_and_path = fs.closest_copy(self.root, self._scoped_path_utf8) 791 if root_and_path: 792 root, path = root_and_path 793 rev = fs.revision_root_revision(root) 794 if (path, rev) == (self.path, self.rev): 795 rev, path = fs.copied_from(root, path) 796 return SubversionNode(path, rev, self.repos, self.pool, root) 789 def get_copy_ancestry(self): 790 ancestors = [] 791 previous = (self._scoped_path_utf8, self._requested_rev, self.root) 792 while previous: 793 (previous_path, previous_rev, previous_root) = previous 794 previous = None 795 root_path = fs.closest_copy(previous_root, previous_path) 796 if root_path: 797 (root, path) = root_path 798 path = path.lstrip('/') 799 rev = fs.revision_root_revision(root) 800 relpath = None 801 if path != previous_path: 802 # `previous_path` is a subfolder of `path` and didn't 803 # change since `path` was copied 804 relpath = previous_path[len(path):].strip('/') 805 copied_from = fs.copied_from(root, path) 806 if copied_from: 807 (rev, path) = fs.copied_from(root, path) 808 path = path.lstrip('/') 809 root = fs.revision_root(self.fs_ptr, rev, self.pool()) 810 if relpath: 811 path += '/' + relpath 812 ui_path = _path_within_scope(self.scope, _from_svn(path)) 813 if ui_path: 814 ancestors.append((ui_path, rev)) 815 previous = (path, rev, root) 816 return ancestors 797 817 798 818 -
branches/0.11-stable/trac/versioncontrol/svn_prop.py
r8310 r8332 124 124 target_rev = context.resource.version 125 125 if has_eligible: 126 node = repos.get_node(target_path, target_rev) 126 127 branch_starts = {} 127 node = repos.get_node(target_path, target_rev) 128 while node: 129 node = node.get_copy_origin() 130 if node and node.path != target_path: 131 branch_starts[node.path] = node.rev + 1 128 for path, rev in node.get_copy_ancestry(): 129 if path not in branch_starts: 130 branch_starts[path] = rev + 1 132 131 rows = [] 133 132 for line in props[name].splitlines(): … … 143 142 spath, revs)] 144 143 if has_eligible: 145 first_rev = branch_starts.get( path)144 first_rev = branch_starts.get(spath) 146 145 eligible = set(repos._get_node_revs(spath, target_rev, 147 146 first_rev))
Note:
See TracChangeset
for help on using the changeset viewer.