public ActionResult Revision(int id, int fileId, int revisionId)
        {
            return ExecApiMethod(() =>
            {
                var userNameInfo = UserName;
                var settings = UserSettings;
                var changeList = GetChangeList(id);
                var changeFile = GetChangeFile(changeList, fileId);

                var gen = new DiffGenerator(db);
                var baseReviewId = gen.GetBaseReviewId(userNameInfo.userName, changeList.Id);
                var fileVersions = changeFile.FileVersions.ToArray();
                var prev = 0;

                if (revisionId == 0 && fileVersions.Length == 1)
                {
                    var left = fileVersions.First();
                    var right = left;

                    var diffFile = gen.GenerateDiffFile(left, right, changeList.CL, baseReviewId, settings, force: false);
                    if (string.IsNullOrEmpty(diffFile) || !System.IO.File.Exists(diffFile))
                        throw new ApplicationException(string.Format("Failed to create a diff file for change list id: {0} file id: {1} revision id: {2}", id, fileId, revisionId));

                    return StreamFile(diffFile);
                }
                for (var idx = prev + 1; idx < fileVersions.Length; prev = idx++)
                {
                    if (revisionId != idx - 1)
                        continue;

                    var vid1 = fileVersions[prev].Id;
                    var vid2 = fileVersions[idx].Id;
                    var left = fileVersions[prev];
                    var right = fileVersions[idx];

                    var diffFile = gen.GenerateDiffFile(left, right, changeList.CL, baseReviewId, settings, force: false);
                    if (string.IsNullOrEmpty(diffFile) || !System.IO.File.Exists(diffFile))
                        throw new ApplicationException(string.Format("Failed to create a diff file for change list id: {0} file id: {1} revision id: {2}", id, fileId, revisionId));

                    return StreamFile(diffFile);
                }

                throw new ApplicationException(string.Format("Did not find revision for change list id: {0} file id: {1} revision id: {2}", id, fileId, revisionId));
            });
        }