Test cases exposed a bug in missing revisions count of working tree. It had an off-by-one error when comparing length of a list with its index (which starts from 0). Fix is to use branch for the lookup of the revno of working tree's last revision and substract that. This keeps revno calculation behind branch API and makes the exception check redundant.