{"id":1728,"date":"2017-12-06T05:06:36","date_gmt":"2017-12-06T05:06:36","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/?p=1728"},"modified":"2025-02-01T22:39:34","modified_gmt":"2025-02-01T22:39:34","slug":"find-perforce-label-info-from-workspace","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/find-perforce-label-info-from-workspace\/","title":{"rendered":"Find perforce Label info from Workspace"},"content":{"rendered":"<p><strong>scmuser created the topic: Find perforce Label info from Workspace<\/strong><br \/>\nHi,<\/p>\n<p>I have perforce workspace which is synced with p4 label specification. i want to know which label has been sync here in my workspace.<\/p>\n<p>Could you please let me know the command for this?<\/p>\n<p><strong>mnanjala replied the topic: Re:Find perforce Label info from Workspace<\/strong><br \/>\nIt&#8217;s not easy, especially when you consider that the workspace might be only partly synced to that label. i.e, the label was used with a more restrictive path than that in the label itself.<\/p>\n<p>One rather crude method is to take each label that might apply to the workspace (you can determine this by the view in the labels, or if you use a meaningful naming convention) and do a test sync (p4 sync -n) of each one in the workspace. With luck, only one of them will show zero actions. However, it&#8217;s possible that more than one will seem correct, or that none of them will.Essentially, you&#8217;re trying to access label information backwards.<br \/>\nThey are aliases for a particular state of the repository, but are not a state in and of themselves. (I.e., &#8220;synced to which label&#8221; isn&#8217;t really meaningful in Perforce.)<\/p>\n<p>If you need to duplicate the state of a workspace into another workspace, are you aware that workspace names are also labels?<br \/>\nYou can sync one workspace to the same state as another by using the other workspace&#8217;s name. (Assuming the views are compatible.)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>scmuser created the topic: Find perforce Label info from Workspace Hi, I have perforce workspace which is synced with p4 label specification. i want to know which label has been&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[370],"tags":[373],"class_list":["post-1728","post","type-post","status-publish","format-standard","hentry","category-perforce","tag-perforce"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/1728","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=1728"}],"version-history":[{"count":1,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/1728\/revisions"}],"predecessor-version":[{"id":1729,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/1728\/revisions\/1729"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=1728"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=1728"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=1728"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}