Topic
  • 2 replies
  • Latest Post - ‏2017-09-08T14:38:42Z by EHcnck
EHcnck
EHcnck
168 Posts

Pinned topic How to determine if a baseline is contained within a set.

‏2014-03-05T14:24:13Z | elliscnck

Hello,

How would one determine if a baseline is contained within a Baseline set?

-Jim

 

  • SudarshanRao
    SudarshanRao
    57 Posts

    Re: How to determine if a baseline is contained within a set.

    ‏2014-03-06T08:21:21Z  

    Probably this is what you are looking for:

    baselineSet(ModuleVersion)

    Declaration
    BaselineSet baselineSet(ModuleVersion modver)

    Operation
    This returns the Baseline Set, if there is one and the user has Read access to it, which contains the given ModuleVersion modver.

    Thanks,
    Sudarshan

  • EHcnck
    EHcnck
    168 Posts

    Re: How to determine if a baseline is contained within a set.

    ‏2017-09-08T14:38:42Z  

    Probably this is what you are looking for:

    baselineSet(ModuleVersion)

    Declaration
    BaselineSet baselineSet(ModuleVersion modver)

    Operation
    This returns the Baseline Set, if there is one and the user has Read access to it, which contains the given ModuleVersion modver.

    Thanks,
    Sudarshan

    Am I doing something wrong if I open the module "Current" and use BaselineSet baselineSet(ModuleVersion modver) I get a valid BaselineSet which doesn't make sense.  I want the BaselineSet is it exist for an version module I open, meaning what set was this version rev op in?

     

    BaselineSet getBaselineSet(ModuleVersion &mv) {
            BaselineSetDefinition bsd
            ModName_ mod = module(mv)
            for bsd in mod do {
                    string errmess = read(bsd)
                    if (!null errmess) {
                            return null
                    } else {
                            BaselineSet bs
                            for bs in bsd do {
                                    ModuleVersion v
                                    for v in bs do {
                                            if (uniqueID(module(v)) == uniqueID(module(mv))) {
                                                    if (versionString v == versionString mv) {
                                                            return bs
                                                    }
                                            }
                                    }
                            }
                    }
            }
    
            return null
    }
    
    ModuleVersion mv = moduleVersion(current Module)
    BaselineSet bs = getBaselineSet(mv)             
    if (null bs) {
            ack "Null"
    } else {
            ModuleVersion mv
            for mv in bs do {
                    print " " (fullName mv) " [" (versionString mv) "]\n"
            }
    }
    delete mv