Commit 22e420d4 authored by Leigh Stoller's avatar Leigh Stoller

If the template being modified is "active" then move the active bit to

the child template (parent no longer active).
parent 63cfbd3a
......@@ -173,6 +173,8 @@ sub logfile($) {
return ((! ref($_[0])) ? -1 : $_[0]->{'TEMPLATE'}->{'logfile'}); }
sub logfile_open($) {
return ((! ref($_[0])) ? -1 : $_[0]->{'TEMPLATE'}->{'logfile_open'}); }
sub active($) {
return ((! ref($_[0])) ? -1 : $_[0]->{'TEMPLATE'}->{'active'}); }
#
# Lookup a template given an experiment index.
......@@ -1776,6 +1778,16 @@ sub InActivate($)
return 0;
}
sub IsActive($)
{
my ($self) = @_;
# Must be a real reference.
return -1
if (! ref($self));
return $self->active();
}
# Improve this at some point.
sub Recurse($$)
......
......@@ -786,6 +786,15 @@ system("$makegraph $guid");
fatal(-1, "Error generating template graph.")
if ($?);
#
# Make the new template active (and the parent template inactive) if the
# parent was already active.
#
if ($parent_template->IsActive()) {
$parent_template->InActivate();
$template->Activate();
}
#
# Update parent to point to most recent child.
#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment