[英]How do I get MKS project details based on filename?
Is there anyway to get the project under which the file is present in MKS command line interface? 无论如何,要获得在MKS命令行界面中存在该文件的项目? I am new to CLI scripting for MKS and could not find any proper results. 我是MKS的CLI脚本的新手,无法找到任何正确的结果。
All I want is 我想要的就是
-> [command] [filename] -> [project path]/project.pj -> [命令] [文件名]-> [项目路径] /project.pj
Any help is greatly appreciated. 任何帮助是极大的赞赏。
The command si locate
with a specific configuration, can return the project/projects where a file is registered. 使用特定配置si locate
命令可以返回注册文件的一个或多个项目。 This functionality is available only with DB back-end repository and will not work with RCS repository . 此功能仅适用于DB后端存储库 ,不适用于RCS存储库 。
If you want to get the project under which the file is located you must ensure that in the MKS repository exists only one file with this name, otherwise, you will get all projects where is located this file. 如果要获取文件所在的项目,则必须确保MKS存储库中仅存在一个具有该名称的文件,否则,将获取该文件所在的所有项目。
You can use this command, which for me works fine, or you can customize for your needs 您可以使用此命令,该命令对我来说效果很好,也可以根据需要进行自定义
si locate –hostname=%mks_Hostname% --port=%msk_Port% --user=%mks_User% --depth=all --devpathscope=all --exactmatch --listfields=devpath,name,project,checkpoints,dates --memberbyname="%Filename%"
si locate help si找到帮助
Usage: si locate options... current or former member/subproject; options are:
--[no]casesensitive Make search case sensitive (default is --nocasesensitive for case insensitive servers)
--depth=[current|build|all] How much historical data should be encompassed in the search
--devpathscope=[this|others|all] Which devpaths should be encompassed in the search
--distinct=[project|devpath|registeredproject] In distinct mode, what output should be displayed
--[no]exactmatch Match search string exactly (default is --noexactmatch)
--height=value The height in pixels of the windows
--[no]limittoactivepaths Limit search to active projects
--listfields=field1[:width1],field2[:width2]... where fieldn can be any of: checkpoints,configPath,dates,devpath,flatPath,name,project,registeredproject,revisions
--memberbyname=value The search string for Locate member by name
--mode=[distinct|list] Output mode
--numberofresults=value The maximum number of results to return
--projectscope=[this|others|all] Which projects should be encompassed in the search
-r value lookup a single revision (for members)
--revision=value lookup a single revision (for members)
--subprojectbyname=value The search string for Locate subproject by name
--width=value The width in pixels of the windows
-x value The x location in pixels of the window
-y value The y location in pixels of the window
--devpath=value The development path (to refer variant projects)
--[no]failOnAmbiguousProject Whether to abort when multiple projects correspond to a flat project string.
-P value The name of the target project
--project=value The name of the target project
--projectRevision=value The project revision (to refer build projects)
-S value The name of the sandbox (can be used as project redirector)
--sandbox=value The name of the sandbox (can be used as project redirector)
-? Shows the usage for a command
--[no]batch Control batch mode (no user interaction in batch mode)
--cwd=value Act as if command executed in specified directory
--forceConfirm=[yes|no] Specify an answer to all confirmation questions
-g User interaction should happen via the GUI
--gui User interaction should happen via the GUI
--hostname=value Hostname of server
-N Responds to all confirmations with "no"
--no Responds to all confirmations with "no"
--password=value Credentials (e.g., password) to login with
--port=value TCP/IP port number of server
--quiet Control status display
--settingsUI=[gui|default] Control UI for command options
--status=[none|gui|default] Control status display
--usage Shows the usage for a command
--user=value Username to login to server with
-Y Responds to all confirmations with "yes"
--yes Responds to all confirmations with "yes"
As for si locate: 至于si找到:
Provided that your current directory is somewhere in the tree of a registered sandbox you could just memorize 只要您当前的目录位于已注册沙箱的树中,您就可以记住
si locate filename
eg 例如
c:\>my_sandboxes\prjA\src>si locate main.c
You might get multiple results/answers eg. 您可能会获得多个结果/答案,例如。 if the project has variants and/or the archive is shared in multiple projects the server. 如果项目具有变体和/或归档在多个项目中共享,则服务器。
If you want all the sophisticated possibilities of Member->Locate from the gui you sholud read some reference eg. 如果您希望从gui中获得Member-> Locate的所有复杂功能,则可以阅读一些参考资料,例如。 SourceCLIReference_Integrity_10_4.pdf or like already mentioned. SourceCLIReference_Integrity_10_4.pdf或类似已经提到的。
si locate help
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.