How to get modified dates of remote files in baseline using the command line (scm)
Trying to get a list of the files in a particular baselines along with their version numbers and last changed dates, think I need a combination of the following commands: - lscm list remotefiles lscm list changesets lscm list changes Seems like this should be easier, am I missing a trick, really hoping for some sort of date parameter on the lscm list remotefiles command or some way to get the changeset from the each file listed in the list remotefiles command. Any top tips ;-) Thanks Richard |
3 answers
Might as well add my solution for completeness! I think this forum should allow file attachments, you lose something by having to paste things in the old fashioned way The following is the batchfile I use to fire my powershell script: -
::Example Invocation remember quotes even if there are no spaces
And the powershell script processRemoteFiles.ps1 is as follows (edited to fix school boy error regarding spaces in component/ baseline/ stream names): -
#send workspace, baseline, component, repository url, username, userPassword and on the command line and process in this powershell script
#this could be fired by calling listBaselineDetails.bat providing just the required details
#for debugging: -
$scmLocation =$args[6]
#remote file hashtable used to avoid adding deleted files to the listing
#List changesets in baseline we want the modification date and the UUID of each item need to cope with spaces in component and baseline name
$psi.Arguments = $comLineArgs;
#need to specify width of line, if running from batch file else command window settings anomaly truncates line length to 60 (depends on your PC)
|
The only way I can think of getting what you need is by following these commands, similar to what you have suggested -
1. Get the baseline. You can run the command >lscm list baselines -C <component id> -r <repository> -P <password> -u <userid> 2. Use a baseline to get all changesets in it >lscm list changesets -C <component id> -b <baseline id> -r <repository> -P <password> -u <userid> The result will look like this - Change sets: (1079) ----$ Surya Tripathi "abc.def.ghj" 14-Jan-2016 03:18 PM (1080) ----$ Surya Tripathi "Share" 17-Dec-2015 10:57 PM (1081) ----$ Surya Tripathi "Share" 17-Dec-2015 10:52 PM (1082) ----$ Surya Tripathi "Initial for Comp1" 17-Dec-2015 10:48 PM 3. You can get changes for multiple changesets in one command- >lscm list changes 1079 1080 1081 1082 -r <repository> -P <password> -u <userid> -i The result will look like this - Change sets: (1079) ----$ Surya Tripathi "abc.def.ghj" Component: (1076) "Comp1" Modified: 14-Jan-2016 03:18 PM Changes: --a-- (1083) \<unresolved>\.project [ -> 1] --a-- (1084) \<unresolved>\.project [ -> 1] ---c- (1085) \<unresolved>\Form1.cs [1 -> 2] ---c- (1086) \<unresolved>\Form1.Designer.cs [1 -> 2] --a-- (1087) \<unresolved>\Form1.resx [ -> 1] (1080) ----$ Surya Tripathi "Share" Component: (1076) "Comp1" Modified: 17-Dec-2015 10:57 PM Changes: --a-- (1088) \<unresolved>\.jazzignore [ -> 1] --a-- (1089) \<unresolved>\.jazzignore [ -> 1] --a-- (1090) \<unresolved>\.jazzignore [ -> 1] --a-- (1091) \<unresolved>\App.config [ -> 1] --a-- (1092) \<unresolved>\AssemblyInfo.cs [ -> 1] . . . . |
I have come back to this problem after being taken away to do other things. I have managed to create a powershell script that processes the JSON output of the commands similar to those mentioned by Surya to give the required output. i.e filename, modification date, version number for each file in the baseline. I now ideally wish to have this on an eclipse menu item So a corollary to this issue is: How best would I integrate this tool with rtc / is it possible. I really want to right click on a baseline in a component in a stream and have a menu item that comes up saying "output listing with dates and version" or similar. Is this possible, some sort of plugin/ extension maybe or is it best for it to be an external tool? Comments
Don Yang
commented Mar 03 '16, 5:43 p.m.
Hi, Richard
Richard Good
commented Mar 04 '16, 4:42 a.m.
Thanks, but not really what I want, I'm after a listing of the contents of a baseline along with their last modified date and version number, not really interested in changeset numbers for this task |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.