Example #1
0
 public Revision(string[] attribs, string basePath)
 {
     revision = attribs[2];
     path     = Compress.getFileBasePathGIT(attribs[4], basePath);
     file     = Compress.getFileNameGIT(attribs[4]);
     size     = attribs[3];
 }
Example #2
0
 public Revision(XmlNode node, string basePath)
 {
     revision = Compress.getFileRevisionSVN(node);
     path     = Compress.getFileBasePathSVN(node, basePath);
     file     = Compress.getFileName(node);
     size     = Compress.getFileSizeSVN(node);
 }
Example #3
0
        static void Main(string[] args)
        {
            string path;

            if (0 == args.Length)
            {
                path = "config.txt";
            }
            else
            {
                path = args[0];
            }

            Console.WriteLine(@"start make revision.");
            using (StreamReader reader = new StreamReader(path))
            {
                string name  = reader.ReadLine();
                int    count = Convert.ToInt32(reader.ReadLine());
                using (Compress compress = new Compress())
                {
                    for (int i = 0; i < count; i++)
                    {
                        string   line  = reader.ReadLine();
                        string[] paths = line.Split(',');
                        string   data  = string.Empty;
                        if (paths[0] == "svn")
                        {
                            data = runSVN(paths[1]);
                            compress.parseStrSVN(data, paths.Length <= 2 ? "" : paths[2]);
                        }
                        else if (paths[0] == "git")
                        {
                            data = runGIT(paths[1]);
                            compress.parseStrGIT(data, paths.Length <= 2 ? "" : paths[2]);
                        }
                        else
                        {
                            Console.WriteLine("Wrong config format.");
                        }
                    }
                    compress.writeFile(name);
                }
                reader.Close();
            }

            Console.WriteLine(@"makeeeeee success.");
            Console.ReadKey(true);
        }
Example #4
0
        static void Main(string[] args)
        {
            string path;
            if (0 == args.Length) path = "config.txt";
            else path = args[0];

            Console.WriteLine(@"start make revision.");
            using (StreamReader reader = new StreamReader(path))
            {
                string name = reader.ReadLine();
                int count = Convert.ToInt32(reader.ReadLine());
                using (Compress compress = new Compress())
                {
                    for (int i = 0; i < count; i++)
                    {
                        string line = reader.ReadLine();
                        string[] paths = line.Split(',');
                        string data = string.Empty;
                        if (paths[0] == "svn")
                        {
                            data = runSVN(paths[1]);
                            compress.parseStrSVN(data, paths.Length <= 2 ? "" : paths[2]);
                        }
                        else if (paths[0] == "git")
                        {
                            data = runGIT(paths[1]);
                            compress.parseStrGIT(data, paths.Length <= 2 ? "" : paths[2]);
                        }
                        else
                        {
                            Console.WriteLine("Wrong config format.");
                        }
                    }
                    compress.writeFile(name);
                }
                reader.Close();
            }

            Console.WriteLine(@"makeeeeee success.");
            Console.ReadKey(true);
        }
Example #5
0
 public void appendSVN(XmlNode node)
 {
     file += "," + Compress.getFileName(node);
     size += "," + Compress.getFileSizeSVN(node);
 }