diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-04-30 12:27:49 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-04-30 12:27:49 +0200 |
commit | 0eed5982bbca328cc6319d36708d64a285160972 (patch) | |
tree | 08adc035640e3869aac6c71ccd8b6cebd73ad442 /bdep/init.cxx | |
parent | b2d5f82512d0118a0668ce02f1a0730c3dcd50b8 (diff) |
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.
Diffstat (limited to 'bdep/init.cxx')
-rw-r--r-- | bdep/init.cxx | 60 |
1 files changed, 31 insertions, 29 deletions
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. |