u2468 Posted March 16, 2015 Report Share Posted March 16, 2015 How do I specify the path to the workarea in the cm command? I understand I can use the command from inside the work area but for scripts I want to specify the path to the work area in the cm command without being inside the work area. for example: Inside work area: cm diff 1 7 Outside work area: cm diff path2workarea? 1 7 How do you do it? Link to comment Share on other sites More sharing options...
manu Posted March 17, 2015 Report Share Posted March 17, 2015 Hello! instead of specifying a work area (workspace) you need to specify the full object specification. In your case you'll want to do it for changesets, for example: cm diff 1@stealth@192.168.1.3:8087 7@stealth@192.168.1.3:8087 Link to comment Share on other sites More sharing options...
u2468 Posted March 17, 2015 Author Report Share Posted March 17, 2015 Hello! instead of specifying a work area (workspace) you need to specify the full object specification. In your case you'll want to do it for changesets, for example: cm diff 1@stealth@192.168.1.3:8087 7@stealth@192.168.1.3:8087 That will work. Thanks! Link to comment Share on other sites More sharing options...
manu Posted March 17, 2015 Report Share Posted March 17, 2015 Great! Link to comment Share on other sites More sharing options...
u2468 Posted March 17, 2015 Author Report Share Posted March 17, 2015 Is there a view in Plastic SCM that will show me the repo domain that can be copied into the clip board? Under Items view, if I right click on the top folder (that shows the full path to the WA) then select "Repository", it shows the repo domain but its grayed out and can't be copied to the clipboard. Also in the Repositories view, the repo domains there can't be copied into the clipboard either. It would be handy to, someplace, be able to copy the repo domain to the clip board. Because at my company they are going to end up with ridiculously long repository domain names like : "143049282_MY2020_Apple_Beta_Amazon_Self_Drive_Laptop_Entertainment_System_Pilot_Config_ 24920@our.domain.names.are.also.very.long.com:8087". Do you see what I mean? ;-) Link to comment Share on other sites More sharing options...
manu Posted March 17, 2015 Report Share Posted March 17, 2015 Hi! Yes. You can copy the repository spec from the Branch explorer. Just click any of the changesets and in the options panel you can get it. It also works from the changesets/branches/labels view. You'll need to click in the properties button. Link to comment Share on other sites More sharing options...
u2468 Posted March 17, 2015 Author Report Share Posted March 17, 2015 Hi! Yes. You can copy the repository spec from the Branch explorer. Just click any of the changesets and in the options panel you can get it. It also works from the changesets/branches/labels view. You'll need to click in the properties button. Ok, I see it. Thanks! Link to comment Share on other sites More sharing options...
u2468 Posted March 17, 2015 Author Report Share Posted March 17, 2015 Hello! instead of specifying a work area (workspace) you need to specify the full object specification. In your case you'll want to do it for changesets, for example: cm diff 1@stealth@192.168.1.3:8087 7@stealth@192.168.1.3:8087 So I'm doing this so my script doesnt have to be inside the work space. The cm diff gives me file names back. cm diff 6@local_test_repo2@localhost:8087 7@local_test_repo2@localhost:8087 C "/f1.txt" C "/f2.txt" C "/f3.txt" Next I want to get the files with 'cm cat' Usage: cm getfile | cat rev_spec [--file=output_file] [--debug] [--symlink] [--raw] Remarks: A rev_spec is defined as: [rev:]item_path[#(br_spec|cset_spec|lb_spec)][@rep_spec] ... where cset_spec is cs:cs_number But: cm cat rev:/f1.txt#cs:7@local_test_repo2@localhost:8087 The specified revision was not found rev:/f1.txt#cs:7@local_test_repo2@localhost:8087 I've try several different variations but I can't seem to get it right. What am I doing wrong? -------------------------------------------------------------------------------------------------------------- Update: This is broken. The only way I can get this to work is by using the full path: cm cat /Users/joe/Desktop/plasticworkspaces/test2/f1.txt#cs:6@local_test_repo2@localhost:8087 It's raining; it's pouring. The old man is snoring. He went to bed and bumped his head, And he wouldn't get up in the morning. But if I have to use the full file path then the repo domain option is altogether superfluous. cm cat /Users/joe/Desktop/plasticworkspaces/test2/f1.txt#cs:6 It's raining; it's pouring. The old man is snoring. He went to bed and bumped his head, And he wouldn't get up in the morning. 'cm diff' and 'cm cat' are inconsistent with regard to using the repo domain options. If I'm using the repo domain option with "cm cat" then the path should be relative to the repo BASE, not the full path in the file system. Link to comment Share on other sites More sharing options...
manu Posted March 18, 2015 Report Share Posted March 18, 2015 Sorry I didn't go further. I'll tell you how to do it (although I'll review the issue you mentioned about the full path, I think we can improve it) First get the changeset diff in a machine friendly format: cm diff 11@testrepo@tardis:8087 12@testrepo@tardis:8087 --format="LeftRev:{3}--RightRev:{2}--ChangeType:{0}--RelativePath:{1}" You will get the revisions ID, something that can be used for the second diff command, this is an example: LeftRev:1999--RightRev:2049--ChangeType:C--RelativePath:/heavyweapons.qc You can parse that in order to invoke the diff tool: cm diff revid:1999@testrepo@tardis:8087 revid:2019@testrepo@tardis:8087 Or even the cat to run your own diff later: cm cat revid:1999@testrepo@tardis:8087 --file=left.heavyweapons.qc cm cat revid:2049@testrepo@tardis:8087 --file=right.heavyweapons.qc yourdifftool left.heavyweapons.qc right.heavyweapons.qc Hope it helps! Link to comment Share on other sites More sharing options...
u2468 Posted March 18, 2015 Author Report Share Posted March 18, 2015 Great! Thanks! Link to comment Share on other sites More sharing options...
manu Posted March 23, 2015 Report Share Posted March 23, 2015 You're welcome! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.