fix incorrect HgRepo.ls behavior when given directory flag

HgRepo.ls appears to have trouble with the `directory` flag. In at least the case where the desired directory is one dir deep, it lists the contents of the directory rather than returning [{'type': 'd'}]