Skip to main content
1-Visitor
October 4, 2016
Solved

How can get list of files and their revisions with condition/filter =Out of Sync Members.

  • October 4, 2016
  • 2 replies
  • 6398 views

Basically it is easy to get the list of files Out of Sync Members using the filer in the IMS client + check box "Hide empty sandboxes"

I wonder if I can reproduce this filter using SI CLI, so far I tried with

si viewsanbox

but this command lists all files in the selected folder or project. I would like to have only those with the filter mentioned above.

Thanks.

    Best answer by kthierer

    si print seems to use si rlog internally

    Unfortunatly when you try  to configure the output of si print you might fall into the trap

    that it behaves like the si rlog command which by default outputs all revisions.

    So then it is better to use the more complicated si rlog directly.

    You might use the following as template to achieve what you want:

    si rlog --recurse --revision=:member --filter=changed:sync --format="MN:\"\{membername}\" \t MR:{memberrev} \t WR:{workingrev}\n" --noHeaderFormat --noTrailerFormat

    The output here looks like

    MN:"release\README.txt"      MR:1.1      WR:1.1 (The fields are also separated by TABs)

    Note that WR:... may be empty if there is no working file or the revision is unknown in your sandbox.

    The main trick to prevent si rlog from ouputtting multiple lines for a certain member (one for each revision)

    is to use the option --revision=:member

    Extraxt from the CLI Reference for Configuration Management

    --format options use the same values as --fields, but similar to a JAVA MessageFormat string (that is, it requires { } to surround

    each field). The --fields option automatically adds a newline on the end, but you must supply the newline for formats with a \n

    ...

    Regards

      Jürgen

    2 replies

    16-Pearl
    October 7, 2016

    Hi Jorge Guzman,

    Try si viewsandbox --filtersubs.  The --filtersubs argument hides empty projects on my system.  That argument should also work with si viewproject.

    Reference:  si viewsandbox

    Regards,
    Kael

    Edits: 

    2016-10-07EDT1108: Added Reference link to si viewsandbox

    12-Amethyst
    October 11, 2016

    If you're just out for the location of the files files and dont need subproject/subsandbox info at all

    you could also have a more compact view and try

    si print --recurse --filter=changed:sync

    For a better parseable format that also adresses whitespace in filenames its a little more complicated:

    si rlog--recurse --revision=:member --filter=changed:sync --format="\"\{membername}\" \t {memberrev}\n" --noHeaderFormat --noTrailerFormat

    Regards,

         Jürgen

    jguzman1-VisitorAuthor
    1-Visitor
    October 12, 2016

    Hello Klaus,

    I tried the si print and it works partially. For my sandbox the cmd

         si print --recurse --filter=changed:sync

    returns all out-of-sync files in the project. This is exactly want I wanted as filter. The results looks like this:

        project_folder\myFile.c 1.2 archive

    Where 1.2 is the member revision. I been trying to see if the output of the command also prints the working revision. So I see both, member and current working rev in the project sbx.

    Any idea how can be achieved?

    I tried this:

       si print --recurse --filter=changed:sync --revision=:working

    But did not worked, command still shows the member revision only.

    Thanks, Regards,

    Jorge

    kthierer12-AmethystAnswer
    12-Amethyst
    October 13, 2016

    si print seems to use si rlog internally

    Unfortunatly when you try  to configure the output of si print you might fall into the trap

    that it behaves like the si rlog command which by default outputs all revisions.

    So then it is better to use the more complicated si rlog directly.

    You might use the following as template to achieve what you want:

    si rlog --recurse --revision=:member --filter=changed:sync --format="MN:\"\{membername}\" \t MR:{memberrev} \t WR:{workingrev}\n" --noHeaderFormat --noTrailerFormat

    The output here looks like

    MN:"release\README.txt"      MR:1.1      WR:1.1 (The fields are also separated by TABs)

    Note that WR:... may be empty if there is no working file or the revision is unknown in your sandbox.

    The main trick to prevent si rlog from ouputtting multiple lines for a certain member (one for each revision)

    is to use the option --revision=:member

    Extraxt from the CLI Reference for Configuration Management

    --format options use the same values as --fields, but similar to a JAVA MessageFormat string (that is, it requires { } to surround

    each field). The --fields option automatically adds a newline on the end, but you must supply the newline for formats with a \n

    ...

    Regards

      Jürgen