这是我的代码,我想把文件签出到默认的更改列表。
但我不知道我的默认更改列表ID。我如何获取它?

string command = "-c";
string f = filePath;
cmd = new P4Command(p4, "add", true, command, changelist.Id.ToString(), "-f", f);
rslt = cmd.Run();
f = filePath.Replace("@", "%40");
cmd = new P4Command(p4, "edit", true, command, changelist.Id.ToString(), f);
rslt = cmd.Run();
cmd = new P4Command(p4, "reopen", true, command, changelist.Id.ToString(), f);
rslt = cmd.Run();发布于 2020-04-15 14:46:18
不需要把事情搞得过于复杂--它被称为“默认”,因为当您没有指定更改列表时,它实际上就是默认的。“默认更改列表”并不是真正的更改列表;它只是在您的客户端上打开的文件的集合,这些文件还不属于编号的更改列表。
C:\Perforce\test>p4 edit foo
//stream/main/foo#4 - opened for edit
C:\Perforce\test>p4 opened
//stream/main/foo#4 - edit default change (text)我认为就您的代码而言,这是:
cmd = new P4Command(p4, "edit", true, f);
rslt = cmd.Run();只需去掉"-c“(代表" changelist ")和changelist编号即可。
如果需要将文件从编号更改移到缺省更改中,可以使用p4 help reopen中所述的reopen命令
reopen -- Change the filetype of an open file or move it to
another changelist
p4 reopen [-c changelist#] [-t filetype] file ...
...
The target changelist must exist; you cannot create a changelist by
reopening a file. To move a file to the default changelist, use
'p4 reopen -c default'.发布于 2020-04-15 14:12:34
我想我找到答案了。不要输入默认,只需输入关键字:“changeId”,如下所示。
string command = "-c";
cmd = new P4Command(p4, "add", true, command, "default", "-f", f);
cmd = new P4Command(p4, "edit", true, command, "default", f);
cmd = new P4Command(p4, "reopen", true, command, "default", f);https://stackoverflow.com/questions/61222118
复制相似问题