使用更改列表编号获取filespecs

时间:2013-03-29 17:05:05

标签: c# .net perforce

我必须使用changeid提取Filespecs这些FileSpecs与我在此更改列表中更改的文件相关 我尝试使用此代码

string change = value;
Options optionfilespec = new Options();
optionfilespec.Add(id.ToString(),"");
P4Command commadfilespec = new P4Command(ps, "where", true, change);
P4CommandResult res= commadfilespec.Run(optionfilespec);

或者我可以使用这个

int id = int.Parse(change);
Changelist changelist= rep.GetChange(id);
IList <Perforce.P4.FileMetaData> files= changelist.Files;
foreach (FileMetaData fmd in files)
{ 
            //get the depot path and create instances from filespec            

}

2 个答案:

答案 0 :(得分:1)

后一种方法就是你想要的。我不确定你的代码片段是否100%正确,但方法是正确的。

答案 1 :(得分:0)

第二种方法是正确的

int id = int.Parse(change);
Changelist changelist= rep.GetChangelist(id);
IList <Perforce.P4.FileMetaData> files= changelist.Files;
foreach (FileMetaData fmd in files)
    { 
                //get the depot path and create instances from filespec            

    }