c# - Perforce API : Repository. GetChangeLists 返回没有文件的列表

标签 c# api perforce

我正在使用 p4api.net(版本 2015.1.105.4164)尝试检索一些影响特定路径的更改列表。 我的问题是:所有返回的列表都声明根本没有文件,这很矛盾,因为没有受影响文件的更改列表根本不代表更改。在 P4V 中,返回的更改列表当然至少显示一个文件。

我做错了什么?为什么每个返回的更改列表的 Files.Property 总是空的?

  private void ListSubmittedChangeLists(string path, string client, string user, int maxLists)
  {
     ChangesCmdFlags flags = ChangesCmdFlags.IncludeTime & ChangesCmdFlags.FullDescription;
     var options = new Options(flags, client, maxLists, ChangeListStatus.Submitted, user);
     IList<Changelist> lists = Repository.GetChangelists(options, new FileSpec(new DepotPath(path), VersionSpec.Head));
     Console.WriteLine("{0} lists found.", lists.Count);
     foreach (Changelist list in lists)
     {            
        Console.WriteLine("{0} files found in changelist {1}.", list.Files.Count, list.Id);
        foreach (FileMetaData file in list.Files)
        {               
           Console.WriteLine(file.ClientPath);
        }
     }
     Console.WriteLine("Done.");
     Console.ReadLine();
  }

编辑:我找到了一个解决方法:对于返回的每个更改列表,我必须调用 Repository.GetChangeList(list.Id);这将返回一个列表对象,其文件集合已填充...

最佳答案

您在编辑问题时描述的解决方法实际上是正确的答案。

GetChangelists 返回有关更改的摘要信息,但不返回有关更改中每个文件的信息。 GetChangeList 返回更改中文件的详细信息。

关于c# - Perforce API : Repository. GetChangeLists 返回没有文件的列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38583870/

相关文章:

c# - 将参数添加到 WCF .svc 文件

php - 如何在 Wordpress 中集成第三方 API

api - 休息 API : Is it a really bad practice to create custom HTTP response codes?

javascript - 使用 soundloud API 从用户源获取所有轨道

c# - 扩展 WebService 代理类(从 WSDL 导入)方法

c# - 自动选择数字证书对话框

强制使用 UNC 名称来命名长文件

windows - Perforce:如何从更改列表创建文件列表?

c# - 正则表达式,从分隔字符串中删除重复路径

perforce - 从 Perforce 获取文件的工作区位置