From 0eed5982bbca328cc6319d36708d64a285160972 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 30 Apr 2018 12:27:49 +0200 Subject: Implement multi-project synchronization Now the same configuration can be shared by multiple projects and a sync command from any of them (or from the build system hook) will synchronize everyting. --- bdep/init.cxx | 60 ++++++++++++++++++++++++++++++----------------------------- 1 file changed, 31 insertions(+), 29 deletions(-) (limited to 'bdep/init.cxx') diff --git a/bdep/init.cxx b/bdep/init.cxx index 303c475..f03b7cc 100644 --- a/bdep/init.cxx +++ b/bdep/init.cxx @@ -170,38 +170,40 @@ namespace bdep return 0; } - // Make sure everyone refers to the same objects across all the - // transactions. - // - session s; - - // --config-add/create - // configurations cfgs; - if (ca || cc) { - cfgs.push_back ( - cmd_init_config ( - o, - o, - prj, - db, - ca ? o.config_add () : o.config_create (), - args, - ca, - cc)); - - // Fall through. - } + // Make sure everyone refers to the same objects across all the + // transactions. + // + session s; - // If this is the default mode, then find the configurations the user - // wants us to use. - // - if (cfgs.empty ()) - { - transaction t (db.begin ()); - cfgs = find_configurations (prj, t, o); - t.commit (); + // --config-add/create + // + if (ca || cc) + { + cfgs.push_back ( + cmd_init_config ( + o, + o, + prj, + db, + ca ? o.config_add () : o.config_create (), + args, + ca, + cc)); + + // Fall through. + } + + // If this is the default mode, then find the configurations the user + // wants us to use. + // + if (cfgs.empty ()) + { + transaction t (db.begin ()); + cfgs = find_configurations (prj, t, o); + t.commit (); + } } // Initialize each package in each configuration. -- cgit v1.1