def test_empty_changeset(self): repos = Mock() changeset = EmptyChangeset(repos, 1) self.assertEqual(repos, changeset.repos) self.assertEqual(1, changeset.rev) self.assertEqual('', changeset.author) self.assertEqual('', changeset.message) self.assertEqual(datetime(1970, 1, 1, tzinfo=utc), changeset.date) self.assertEqual([], list(changeset.get_changes()))
def get_changes(repos, revs, log=None): changes = {} for rev in revs: if rev in changes: continue try: changeset = repos.get_changeset(rev) except NoSuchChangeset: changeset = EmptyChangeset(repos, rev) if log is not None: log.warning("Unable to get changeset [%s]", rev) changes[rev] = changeset return changes