'Return a list of segments between a child and its ancestor.
For example, in the case of a path X representing /a/b/c/d and a path Y
representing /a/b, C{Y.segmentsFrom(X)} will return C{[\'c\',
\'d\']}.
@param ancestor: an instance of the same class as self, ostensibly an
ancestor of self.
@raise: ValueError if the \'ancestor\' parameter is not actually an
ancestor, i.e. a path for /x/y/z is passed as an ancestor for /a/b/c/d.
@return: a list of strs'

def segmentsFrom(self, ancestor):

    f = self
    p = f.parent()
    segments = []
    while ((f != ancestor) and (p != f)):
        segments[0:0] = [f.basename()]
        f = p
        p = p.parent()
    if ((f == ancestor) and segments):
        return segments
    raise ValueError(('%r    not    parent    of    %r' % (ancestor, self)))
