GetRandomTemporaryFileName() public static method

public static GetRandomTemporaryFileName ( ) : string
return string
Exemplo n.º 1
0
        public static string CreateParentRevisionTempFile(string fileName, string root)
        {
            var tempFileName = HgPath.GetRandomTemporaryFileName();

            tempFileName = Path.ChangeExtension(tempFileName, Path.GetExtension(fileName));

            var command = String.Format("cat \"{0}\"  -o \"{1}\"", HgPath.StripRoot(fileName, root), tempFileName);

            Run(command, root);

            Debug.Assert(File.Exists(tempFileName));

            return(tempFileName);
        }
Exemplo n.º 2
0
        private static void Start(string command, string root, IEnumerable <string> files)
        {
            var listFile    = HgPath.GetRandomTemporaryFileName();
            var listCommand = String.Format("{0} --listfile \"{1}\"", command, listFile);

            CreateListFile(listFile, files);

            var process = Start(listCommand, root);

            try
            {
                process.WaitForExit();
            }
            catch (InvalidOperationException) { }

            DeleteListFile(listFile);
        }