GetRevision() public method

public GetRevision ( string filename ) : string
filename string
return string
コード例 #1
0
        //TODO mode ot RepoManager
        public static DiffFileInfo GenerateDiffFileInfo(GitRepository repository, string filename)
        {
            var info = new DiffFileInfo();

            info.ActualFilename = Path.GetFileName(filename);
            info.ModifiedFilePath = filename;
            info.LastRevision = repository.GetRevision(filename);

            var filetype = Path.GetExtension(filename);

            //write unmodified file to disk
            var unmodifiedFile = repository.GetUnmodifiedFileByAbsolutePath(filename);
            var tempFileName = Path.GetTempFileName() + filetype;
            File.WriteAllText(tempFileName, unmodifiedFile);
            info.UnmodifiedFilePath = tempFileName;

            return info;
        }
コード例 #2
0
        //TODO mode ot RepoManager
        public static DiffFileInfo GenerateDiffFileInfo(GitRepository repository, string filename)
        {
            var info = new DiffFileInfo();

            info.ActualFilename   = Path.GetFileName(filename);
            info.ModifiedFilePath = filename;
            info.LastRevision     = repository.GetRevision(filename);

            var filetype = Path.GetExtension(filename);

            //write unmodified file to disk
            var unmodifiedFile = repository.GetUnmodifiedFileByAbsolutePath(filename);
            var tempFileName   = Path.GetTempFileName() + filetype;

            File.WriteAllText(tempFileName, unmodifiedFile);
            info.UnmodifiedFilePath = tempFileName;

            return(info);
        }