def fromArgument(db, argument): try: return Review.fromId(db, int(argument)) except: from dbutils import Branch branch = Branch.fromName(db, str(argument)) if not branch: return None return Review.fromBranch(db, branch)
def fromName(db, repository, name): from dbutils import Branch return Review.fromBranch(db, Branch.fromName(db, repository, name))