'move this path to target.'

def move(self, target):

    if target.relto(self):
        raise py.error.EINVAL(target, 'cannot    move    path    into    a    subdirectory    of    itself')
    try:
        self.rename(target)
    except py.error.EXDEV:
        self.copy(target)
        self.remove()
