// // aegis - project change supervisor // Copyright (C) 2004-2008, 2011, 2012, 2014 Peter Miller // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see // . // #include #include #include #include project * project::bind_branch(const change::pointer &cp) { assert(cp->project_get() == this); project *pp = 0; trace(("project::bind_branch(this = %p, cp = %p)\n{\n", this, cp.get())); trace(("name = \"%s\"\n", name->str_text)); trace(("cp->number = %ld\n", cp->number_get())); if (cp->is_trunk()) { trace(("no need to be clever\n")); assert(!parent); pp = copy(); } else { // punctuation? string_ty *project_name = str_format ( "%s.%ld", name->str_text, cp->number_get_mzd() ); trace(("name = \"%s\"\n", project_name->str_text)); pp = project_alloc(project_name); // // FIXME: this method has the WRONG name - it should be // project::create_branch so that project::bind_branch can // be used for this else clause. // pp->up = get_user(); pp->uid = uid; pp->gid = gid; pp->parent = copy(); pp->parent_bn = cp->number_get(); pp->pcp = cp; pp->changes_path = str_format("%s.branch", change_path_get(cp->number_get()).c_str()); trace(("change path = \"%s\"\n", pp->changes_path->str_text)); } trace(("return %p;\n", pp)); trace(("}\n")); return pp; } // vim: set ts=8 sw=4 et :