This occurred during an Allura repo refresh. A --clean --all refresh worked around it.
File '/var/local/allura/Allura/allura/model/repo_refresh.py', line 301 in compute_diffs rhs_tree_ids = TreesDoc.m.get(_id=rhs_ci._id).tree_ids AttributeError: 'NoneType' object has no attribute 'tree_ids'
Perhaps consider trapping this error and expunging/invalidating the whole ming session to roll back the changes, so that the repo metadata is not left in an incomplete state (which causes errors on the webapp).
The same error can occur when forking a repo.
If the TreesDoc gets lost for an old commit, then every subsequent refresh will fail because it only looks at new commits to compute the TreesDoc but looks at all commits when doing compute_diffs
Diff: