0
Hello,

I am new to dimension and dmcli, but I need to get revisions of files in a folder.

Given a folder, I need to get all files that belongs to revision 1, and then 2 all way to latest revision recursively.

Is that possible by using dmcli? an example will be really appreciated.

Thanks

M

Accepted Answer

Drewster
Drewster
Offline
Thursday, November 12 2015, 02:29 AM - #Permalink
0
This is where Dimensions baselines come in............
When you are using baselines you take a snapshot of the environment at the time it was taken (within the scope of the baseline you use).
So:
Start point: File1 v1, File2 v1, File3 v1 - Baselined as BL1
"Rev1": (after development etc): File1 v2, File2 v2, File3 now renamed as File3new v1 , FIle4 v1 - Baselined BL2
"Rev2" (ade) FIle 1 deleted, File2 v2 (unchanged), File3new v2 File4 v1 etc - Baselined as BL3

The baselines will hold the exact setup at the point in time - so renamed files will have the "name" they had at the time. Files added & deleted will be where they should be.

Obviously (as per your example) the version of each file taken in isolation isn't always relevant.

Your model looks a little more like the SVN model - where (the entire repository) is snapshot'd at each commit.
This is (in some ways) similar to baselineing as renames/deletions etc are reflected in the Commit.

It would lead to a slightly different issue in that SVN commits are repository wide so if you did a fetch of your directory based on the last 3 commits you could get 3 identical fetches (As the content of the directory hadn't changed in those 3 commits.
So you would have to identify the "3" commits where the directory content had changed in order to identify which commits to fetch (to pick up directory changes).

The two paradigms used both have their "quirks" - they both work well when understood and used "properly" but the transition can be a little perplexing............
The reply is currently minimized Show
Responses (6)
  • Accepted Answer

    Drewster
    Drewster
    Offline
    Wednesday, November 11 2015, 05:03 AM - #Permalink
    0
    Mmmmmmmm it depends (to paraphrase a certain BobbyV).

    It depends on exactly what you have setup already and (what you are actually trying to do).

    Two extremes...

    1)
    if you have Baselines that correspond to your "logic" of "Revision 1" and "Revision 2" etc
    Then you can get the baselines one by one (you can limit your fetch to just the directory of interest rather than fetching the entire baseline). (The DMCLI command is FBI (Fetch Baseline Items))
    This would get you the specific file revisions that correspond to each baseline (wether or not the specific files have had individual revisions).

    2)
    If you just have a load of file revisions.......
    You could (used very advisedly) get all files at their first revision...
    then all files at their second revision...
    and so on....

    Eventually you would have n number of layers of revisions.......

    There would be NO LOGICAL connection between files in your layers....All the revision 1s of all the files might never have existed together at the same time etc etc

    Option 1 - Is fairly simple (it has some quirks depending on naming conventions of baselines etc etc but the logic is there)
    Option 2 - Is possible (syntactically fairly easy) but I am not sure of the use it would be (although you might be able to enlighten me)...........
    I guess it could provide a quick and dirty way to migrate multiple file revisions to another SCM system....

    So if you could be a bit more specific about what you are trying to do (and why)........ We might be able to suggest either the technical way to achieve it or other ways to achieve the end result. :-)
    Like
    • Shailesh Ligade
      more than a month ago
      Thanks Drewster,

      As you mentioned under option 2, I am tasked to migrate part of repo to different repo. As I am fairly new to Dimension CM as well as DMCLI, can you provide any sample code for the option 2. That will be really great.

      My plan is to get the oldest revision locally, process, it, then get the next revision process it, till I don't get any result back. May be there is way to get highest version number first, so that I can control loop better.


      Thanks

      M
    The reply is currently minimized Show
  • Accepted Answer

    Drewster
    Drewster
    Offline
    Wednesday, November 11 2015, 08:43 AM - #Permalink
    0
    OK - Quick and dirty steps (as it's just for a one off :-) )

    This isn't that neat and tidy but it'll work.
    As you say you are new to Dimensions I'll try to spell out noddy steps (but I might forget a few so if it doesn't make sense just ask)

    Basically I'd do a bit of manipulation in Excel or something similar - ie I wouldn't "script" it all but just knock together enough to do it(as it's a one off it's not really worth all the hassle of error checking and all that good stuff)

    1) Establish DMCLI syntax to get a specific version of a specific file
    a) Go into Dimensions GUI
    b) Open a console window
    c) Open a CI/File window (it doesn't really matter which one but it needs to be one that can have multiple versions (Design Part is good enough)
    d) Expand display to show multiple versions
    (If you have 100 files the expanded view may be say 150)
    e) Select a specific version of a single file (Click on it)
    f) Fetch it "somewhere" (it really doesn't matter where as you only want the syntax)
    g) This will display the command you have just executed in the Console window
    h) CUt & paste this into an Excel file (for use later)

    2) Now you know what commands, parameters and data you need in order to get ONE specific file version
    a) Parse it into relevant chunks - ie split it into something along the lines of:
    Command (FI) in one cell
    Item Spec in another (You might not know it is item Spec but is is the bit that is PRODUCT:ItemID;TYPE;Ver etc
    and so on

    Now you can hopefully see that some of the stuff is "fixed" _ the (FI) command, and the parameters /FILENAME= etc
    and some of the stuff is variable - the actual name, the version etc

    and that IF you knew the variable data you could substitute it into the command string (and execute it).

    So
    3) Get all the variable data that you need........
    a) Pick a display you want to work with (Design Part of Items etc it doesn't really matter)
    b) Change your local configuration so that ALL the relevant data is displayed (plus other stuff you can ignore)

    Customise View ==> Select Items and add the required entities (Item Spec is one)

    c) re-open that view (which will now display all the data needed in columns)
    d) Expand versions (so that ALL versions are displayed)
    e) Limit to just the directory you want
    f) Save the display to a csv file

    4) Churn it in Excel
    Use the output data and the parsed command string to generate complete FI command strings..
    NB - For this excercise I would append a "Verx" subdirectory onto your output path so that all Ver1 files go into a Ver1 directory Ver2 into Ver2 etc (so you don't have to worry about overwriting files).

    You'll need to concatenate cells together to generate the commands strings (be careful with quotes, spaces etc)

    This should give you (a lot of) individual commands strings to individually fetch each and every Item revision.

    5) Cut and Paste the command strings into the Dimensions Console window
    Personally I would test a couple of commands first - just to double check the syntax...
    but when it works just Cut & paste the lot...........

    6) Save the output log into a file (there is a little "File save" icon for the console window).

    7) Via Windows explorer - Change the Read Only attribute to R/W (the default fetch will be R/O)

    To be honest as all you are doing is fetching there is very little chance of breaking much - so you can run it repeatedly without fear!!!!.

    There you go:
    Every version of every file (within whatever scope you set) fetched to a series of output directories.... ready for you to do what you like with.......
    Like
    • Shailesh Ligade
      more than a month ago
      Thanks Drewster,

      Looks like revision information must be fetched on file level and not at folder level.

      Say in folder dir1, currently there are 3 files, f1, f2 f3 with last revision 3,4 5 respectively.

      Ideally what I need is, when I ask for revision 1 on dir1, I will get f1:1, f2:1, f3:1 etc

      when I ask for revision 4 on dir1, I will get f2:4 and f3:4 and so on

      however, looks like, I need to know what files are there and their item-spec, which will work most cases..

      e.g. what if a file was deleted in revision 4, that I will not see in GUI, nor I will get item-spec of it. If I can somehow do this on folder level, when I request rev 4 of dir1, deleted file will show up, right?

      Thanks

      M
    The reply is currently minimized Show
  • Accepted Answer

    Kushank
    Kushank
    Offline
    Thursday, August 10 2017, 07:36 AM - #Permalink
    0
    Hello,

    I am trying to automate these steps. Is there any way where I can automatically trigger all FI commands (that I have made in EXCEL file) one by one in dmcli. How do we set a loop in DMCLI and read file line by line ?
    The reply is currently minimized Show
  • Accepted Answer

    Drewster
    Drewster
    Offline
    Monday, August 14 2017, 08:26 AM - #Permalink
    0
    The example above basically does what you are asking for:
    You put all the output in a text file (ie the file contains multiple individual FI commands)
    Then you execute via a batch script using the text file as input (which will then execute line by line).
    (Rather than executing via the Console window)

    The DMCLI syntax can take a Userid and a password plus a /FILE= parameter

    CAVEAT
    It might be worth explaining in more detail exactly what you are trying to do - If we understand your "problem" we can possibly present you with better/best options/solutions.

    The example above was a "solution" to a certain problem rather than "all problems"...

    In so many circumstances knowing what you are actually trying to do can lead to a much better answer rather than forcing a solution to another problem into being your solution.....
    The reply is currently minimized Show
  • Accepted Answer

    Thursday, August 17 2017, 12:53 AM - #Permalink
    0
    This isn't perfect and clean however it'll work.As you say you are new to Dimensions I'll endeavor to illuminate noddy steps (yet I may overlook a couple of so on the off chance that it doesn't bode well simply inquire) Fundamentally I'd do a touch of control in Excel or something comparable - ie I wouldn't "content" it Cheap Assignment Writing Service everything except simply thump sufficiently together to do it(as it's an erratic it's not so much justified regardless of all the bother of blunder checking and all that well done)
    The reply is currently minimized Show
  • Accepted Answer

    Friday, August 18 2017, 09:23 AM - #Permalink
    0
    The other option would be to query the published views to generate the FI commands needed
    The reply is currently minimized Show
Your Reply