예제 #1
0
 def get_copy_ancestry(self):
     """Retrieve the list of `(path,rev)` copy ancestors of this node.
     Most recent ancestor first. Each ancestor `(path, rev)` corresponds
     to the path and revision of the source at the time the copy or move
     operation was performed.
     """
     ancestors = []
     previous = (self._scoped_path_utf8, self.rev, self.root)
     while previous:
         (previous_path, previous_rev, previous_root) = previous
         previous = None
         root_path = fs.closest_copy(previous_root, previous_path)
         if root_path:
             (root, path) = root_path
             path = path.lstrip('/')
             rev = fs.revision_root_revision(root)
             relpath = None
             if path != previous_path:
                 # `previous_path` is a subfolder of `path` and didn't
                 # change since `path` was copied
                 relpath = previous_path[len(path):].strip('/')
             copied_from = fs.copied_from(root, path)
             if copied_from:
                 (rev, path) = copied_from
                 path = path.lstrip('/')
                 root = fs.revision_root(self.fs_ptr, rev, self.pool())
                 if relpath:
                     path += '/' + relpath
                 ui_path = _path_within_scope(self.scope, _from_svn(path))
                 if ui_path:
                     ancestors.append((ui_path, rev))
                 previous = (path, rev, root)
     return ancestors
예제 #2
0
파일: svn_fs.py 프로젝트: t2y/trac
 def get_copy_ancestry(self):
     """Retrieve the list of `(path,rev)` copy ancestors of this node.
     Most recent ancestor first. Each ancestor `(path, rev)` corresponds
     to the path and revision of the source at the time the copy or move
     operation was performed.
     """
     ancestors = []
     previous = (self._scoped_path_utf8, self.rev, self.root)
     while previous:
         (previous_path, previous_rev, previous_root) = previous
         previous = None
         root_path = fs.closest_copy(previous_root, previous_path)
         if root_path:
             (root, path) = root_path
             path = path.lstrip('/')
             rev = fs.revision_root_revision(root)
             relpath = None
             if path != previous_path:
                 # `previous_path` is a subfolder of `path` and didn't
                 # change since `path` was copied
                 relpath = previous_path[len(path):].strip('/')
             copied_from = fs.copied_from(root, path)
             if copied_from:
                 (rev, path) = copied_from
                 path = path.lstrip('/')
                 root = fs.revision_root(self.fs_ptr, rev, self.pool())
                 if relpath:
                     path += '/' + relpath
                 ui_path = _path_within_scope(self.scope, _from_svn(path))
                 if ui_path:
                     ancestors.append((ui_path, rev))
                 previous = (path, rev, root)
     return ancestors
예제 #3
0
    def get_branch_origin(self):
        """Return the revision in which the node's path was created.

        (wraps ``fs.revision_root_revision(fs.closest_copy)``)
        """
        root_and_path = fs.closest_copy(self.root, self._scoped_path_utf8)
        if root_and_path:
            return fs.revision_root_revision(root_and_path[0])
예제 #4
0
파일: svn_fs.py 프로젝트: t2y/trac
    def get_branch_origin(self):
        """Return the revision in which the node's path was created.

        (wraps ``fs.revision_root_revision(fs.closest_copy)``)
        """
        root_and_path = fs.closest_copy(self.root, self._scoped_path_utf8)
        if root_and_path:
            return fs.revision_root_revision(root_and_path[0])