i have to seek difference between files after all the changes of content so how can i read and get the content while they have the same path and directory i have to use that to implement an utility to generate statistics from the code
IList<FileSpec> filesToFind = new List<FileSpec>();
filesToFind.Add( new FileSpec(FileSpec.DepotSpec(dpath).DepotPath, Revision.None));
string[] files = new string[1];
files[0] = dpath;
P4Command command = new P4Command(ps, "where", true, files);
Options opts = new Options();
string v1="", v2="", v3="";
P4CommandResult results = command.Run(opts);
TaggedObjectList list = (results.TaggedOutput);
foreach (TaggedObject obj in list)
{
Console.Out.WriteLine("v1=" + v1 + "hhhhhhhhh1");
int i = 0; string v="";
foreach (String s in obj.Keys)
{
String value = "n/a";
obj.TryGetValue(s, out value);
if (obj.Keys.ElementAt(i).Equals("depotFile"))
v1 = value;
if (obj.Keys.ElementAt(i).Equals("clientFile"))
v2 = value;
if (obj.Keys.ElementAt(i).Equals("path"))
v3 = value;
Console.Out.WriteLine(s + " = " + value);
i++;
}
String path = v3;
if (path==null)
{
Console.WriteLine("Can't' find file, {0}", path);
}
else
{
string extension = Path.GetExtension(path);
if (extension!=null && !("".Equals(extension)))
{
Console.WriteLine("Processing solution file, {0}", path);
FileInfo fi = new FileInfo(path);
using (StreamReader sr = new StreamReader(path, true))
{
Encoding encode = sr.CurrentEncoding;
string line = null;
while ((line = sr.ReadLine()) != null)
{
while (((line = sr.ReadLine()) != null) && (line.Contains("EndGlobalSection") == false))
{
Console.WriteLine(line);
}
}
}
}
}
}
so how differ between the files for exemple when a file was changed six times