Topic
  • 7 replies
  • Latest Post - ‏2006-12-26T16:04:47Z by SystemAdmin
SystemAdmin
SystemAdmin
47283 Posts

Pinned topic Trigger: No checkout reserved

‏2006-12-12T05:34:28Z |
I would like that in specific VOB, will not be any check-outs reserved, at any time.

Does someone have a trigger that prevents users from checking-out on "reserved" mode, and enables users only to check-out "unreserved", or a trigger that automatically turns CO reserved to "unreserved"?

It doesn't matter for me in which way to do that, I just want none CO reserved.

Thanks a lot
  • SystemAdmin
    SystemAdmin
    47283 Posts

    RE:Trigger: No checkout reserved

    ‏2006-12-12T11:15:55Z  
    Any specific reason you are want to prevent a "reserved" checkout ?

    Write a trigger script which checks the value of the Environment
    Variable "CLEARCASE_RESERVED". If this is 1, then it's a reserved
    checkout and you can exit to prevent the checkout.

    A Perl Script example would be like this.
    if ($ENV{CLEARCASE_RESERVED} == 1)
    {
    print "A reserved checkout is not allowed. Please do an
    unreserved checkout.\n";
    exit 1;
    }

    HTH,
    Jayanth
    =====
    -----Original Message-----
    From: cciug-bounces@lists.ca.ibm.com
    mailto:cciug-bounces@lists.ca.ibm.com On Behalf Of atrica
    Sent: Tuesday, 12 December, 2006 11:04
    To: cciug@lists.ca.ibm.com
    Subject: cciug Trigger: No checkout reserved

    I would like that in specific VOB, will not be any check-outs reserved,
    at any time.

    Does someone have a trigger that prevents users from checking-out on
    "reserved" mode, and enables users only to check-out "unreserved", or a
    trigger that automatically turns CO reserved to "unreserved"?

    It doesn't matter for me in which way to do that, I just want none CO
    reserved.

    Thanks a lot
    _______________________________________________
    cciug mailing list
    cciug@lists.ca.ibm.com
    Unsubscribe:cciug-leave@lists.ca.ibm.com

    _______________________________________________
    cciug mailing list
    cciug@lists.ca.ibm.com
    Unsubscribe:cciug-leave@lists.ca.ibm.com
  • SystemAdmin
    SystemAdmin
    47283 Posts

    Re:Trigger: No checkout reserved

    ‏2006-12-12T11:33:27Z  
    All you need to do is have a post-checkout trigger that does a

    "cleartool unres"

    Here is my Perl that encapsulate it:

    my $file = $ENV{'CLEARCASE_PN'};

    system("cleartool unres -nc $file");
    exit 0;
    Paul Franz

    atrica wrote:
    > I would like that in specific VOB, will not be any check-outs reserved, at any time.
    >
    > Does someone have a trigger that prevents users from checking-out on "reserved" mode, and enables users only to check-out "unreserved", or a trigger that automatically turns CO reserved to "unreserved"?
    >
    > It doesn't matter for me in which way to do that, I just want none CO reserved.
    >
    > Thanks a lot
    > _______________________________________________
    > cciug mailing list
    > cciug@lists.ca.ibm.com
    > Unsubscribe:cciug-leave@lists.ca.ibm.com
    >
    _______________________________________________
    cciug mailing list
    cciug@lists.ca.ibm.com
    Unsubscribe:cciug-leave@lists.ca.ibm.com
  • SystemAdmin
    SystemAdmin
    47283 Posts

    Re: Trigger: No checkout reserved

    ‏2006-12-14T08:08:53Z  
    Hi!

    Well, here is one way to do it.

    trigger type "AutoUnreservedCo"
    created 07-Sep-05.16:51:29 by blabla (blabla.bla@s87)
    "Automatically change to unreserved checkedout."
    owner: blabla
    group: bla
    element trigger
    post-operation checkout
    action: -exec if ;then clearprompt proceed -default "abort" -prompt "Warning You are not allowed to checkout this file reserved, this trigger will do an unreserved checkout." -prefer_gui;cleartool unreserve $CLEARCASE_PN;fi
    excluded users: bla

    BR
    Jonas
  • sathiyaseelan
    sathiyaseelan
    26 Posts

    Re: Trigger: No checkout reserved

    ‏2006-12-19T13:40:32Z  
    Hi
    You can merge both the snippet and the script will be like this.

    if ($ENV{CLEARCASE_RESERVED} == 1)
    {
    print "A reserved checkout is not allowed. Hence it is being a unreserved
    checkout.\n";
    my $file = $ENV{'CLEARCASE_PN'};
    system("cleartool unres -nc $file");
    exit 1;
    }
  • SystemAdmin
    SystemAdmin
    47283 Posts

    Re:Re: Trigger: No checkout reserved

    ‏2006-12-19T20:10:45Z  
    Hi
    You can merge both the snippet and the script will be like this.

    if ($ENV{CLEARCASE_RESERVED} == 1)
    {
    print "A reserved checkout is not allowed. Hence it is being a unreserved
    checkout.\n";
    my $file = $ENV{'CLEARCASE_PN'};
    system("cleartool unres -nc $file");
    exit 1;
    }
    You probably don't want to exit 1 in that case - you've already
    "succeeded" in unreserving the checkout.

    What happens to a post-operation trigger that exits 1?

    sathiyaseelan wrote:
    > Hi
    > You can merge both the snippet and the script will be like this.
    >
    > if ($ENV{CLEARCASE_RESERVED} == 1)
    > {
    > print "A reserved checkout is not allowed. Hence it is being a unreserved
    > checkout.\n";
    > my $file = $ENV{'CLEARCASE_PN'};
    > system("cleartool unres -nc $file");
    > exit 1;
    > }
    >
    > _______________________________________________
    > cciug mailing list
    > cciug@lists.ca.ibm.com
    > Unsubscribe:cciug-leave@lists.ca.ibm.com
    >
    >

    -
    Jon Velapoldi

    Jon_Velapoldi@Raytheon.com
    (301) 925-0982
    _______________________________________________
    cciug mailing list
    cciug@lists.ca.ibm.com
    Unsubscribe:cciug-leave@lists.ca.ibm.com
  • SystemAdmin
    SystemAdmin
    47283 Posts

    Re:Re: Trigger: No checkout reserved

    ‏2006-12-19T21:14:21Z  
    You probably don't want to exit 1 in that case - you've already
    "succeeded" in unreserving the checkout.

    What happens to a post-operation trigger that exits 1?

    sathiyaseelan wrote:
    > Hi
    > You can merge both the snippet and the script will be like this.
    >
    > if ($ENV{CLEARCASE_RESERVED} == 1)
    > {
    > print "A reserved checkout is not allowed. Hence it is being a unreserved
    > checkout.\n";
    > my $file = $ENV{'CLEARCASE_PN'};
    > system("cleartool unres -nc $file");
    > exit 1;
    > }
    >
    > _______________________________________________
    > cciug mailing list
    > cciug@lists.ca.ibm.com
    > Unsubscribe:cciug-leave@lists.ca.ibm.com
    >
    >

    -
    Jon Velapoldi

    Jon_Velapoldi@Raytheon.com
    (301) 925-0982
    _______________________________________________
    cciug mailing list
    cciug@lists.ca.ibm.com
    Unsubscribe:cciug-leave@lists.ca.ibm.com
    re: What happens to a post-operation trigger that exits 1?
    nothing really. the operation has already succeeded an there is no bit that
    will act upon this return code (unless you call this script from another
    script)

    hth

    Martina
    Don't Postpone Joy - Have Fun

    ReleaseTEAM Inc
    http://www.releaseteam.com
    IBM Rational Certified Consultants
    IBM Business Partner

    On 12/19/06, Jon Velapoldi <Jon_Velapoldi@raytheon.com> wrote:
    >
    > You probably don't want to exit 1 in that case - you've already
    > "succeeded" in unreserving the checkout.
    >
    > What happens to a post-operation trigger that exits 1?
    >
    > sathiyaseelan wrote:
    > > Hi
    > > You can merge both the snippet and the script will be like this.
    > >
    > > if ($ENV{CLEARCASE_RESERVED} == 1)
    > > {
    > > print "A reserved checkout is not allowed. Hence it is being a
    > unreserved
    > > checkout.\n";
    > > my $file = $ENV{'CLEARCASE_PN'};
    > > system("cleartool unres -nc $file");
    > > exit 1;
    > > }
    > >
    > > _______________________________________________
    > > cciug mailing list
    > > cciug@lists.ca.ibm.com
    > > Unsubscribe:cciug-leave@lists.ca.ibm.com
    > >
    > >
    >
    > --
    > -
    > Jon Velapoldi
    >
    > Jon_Velapoldi@Raytheon.com
    > (301) 925-0982
    >
    >
    > _______________________________________________
    > cciug mailing list
    > cciug@lists.ca.ibm.com
    > Unsubscribe:cciug-leave@lists.ca.ibm.com
    >
    re: What happens to a post-operation trigger that exits 1?
    nothing really. the operation has already succeeded an there is no bit that will act upon this return code (unless you call this script from another script)
     
    hth

    --
    Martina
       Don't Postpone Joy - Have Fun

    ReleaseTEAM Inc
    http://www.releaseteam.com
    IBM Rational Certified Consultants
    IBM Business Partner

     
    On 12/19/06, Jon Velapoldi <Jon_Velapoldi@raytheon.com> wrote:
    You probably don't want to exit 1 in that case - you've already
    "succeeded" in unreserving the checkout.


    What happens to a post-operation trigger that exits 1?

    sathiyaseelan wrote:
    > Hi
    > You can merge both the snippet and the script will be like this.
    >
    > if ($ENV{CLEARCASE_RESERVED} == 1)

    > {
    >  print "A reserved checkout is not allowed. Hence it is being a unreserved
    >  checkout.\n";
    >  my $file = $ENV{'CLEARCASE_PN'};
    >  system("cleartool unres -nc $file");

    >  exit 1;
    >  }
    >
    > _______________________________________________
    > cciug mailing list
    > cciug@lists.ca.ibm.com
    >
    Unsubscribe:cciug-leave@lists.ca.ibm.com

    >
    >

    --
    -
    Jon Velapoldi

    Jon_Velapoldi@Raytheon.com
    (301) 925-0982


    _______________________________________________

    cciug mailing list
    cciug@lists.ca.ibm.com
    Unsubscribe:cciug-leave@lists.ca.ibm.com
    _______________________________________________
    cciug mailing list
    cciug@lists.ca.ibm.com
    Unsubscribe:cciug-leave@lists.ca.ibm.com
  • SystemAdmin
    SystemAdmin
    47283 Posts

    Re: Trigger: No checkout reserved

    ‏2006-12-26T16:04:47Z  
    Hi
    You can merge both the snippet and the script will be like this.

    if ($ENV{CLEARCASE_RESERVED} == 1)
    {
    print "A reserved checkout is not allowed. Hence it is being a unreserved
    checkout.\n";
    my $file = $ENV{'CLEARCASE_PN'};
    system("cleartool unres -nc $file");
    exit 1;
    }
    Thanks a lot, forbidding reserved checkouts works.
    I'm trying to exclude operation of delivery from this forbiddanc, so the delivery operation will work.

    I have tried the following code which didn't work (during the delivery I get the error message: "... Some files could not be checked out in the target view.")
    code
    $pop = $ENV{CLEARCASE_POP_KIND};
    $op = $ENV{CLEARCASE_OP_KIND};

    unless ($pop =~ /deliver/ || $op =~ /deliver/)
    {
    if ($ENV{CLEARCASE_RESERVED} == 1)
    {
    print "A reserved checkout is not allowed. Hence it is being a unreserved
    checkout.\n";
    my $file = $ENV{'CLEARCASE_PN'};
    system("cleartool co -unres -nc $file");
    exit 1;
    }
    }
    [/code]

    Can someone please assist?

    Thanks