WIP: Add explicit `--fetch` flag to bst commands
Description
This introduces a new flag --fetch that was mentioned in the mailing list.
Proposed changes
To put simply, this changes the following commands' behaviour so they'd not try to implicitly fetch junctions and elements (offline-first?).
-
bst {pull,push,track,checkout} element(s)command- Before: Fetches the junction(s) if they are used and not cached yet.
- After: Don't do junction fetch implicitly. In case one is needed, error out by saying
need to fetch junction.--fetchis supplied tofetch_subprojects.
-
bst source-bundle elementcommand- Before: (Possibly track and) fetch implicitly.
- After: Now we have 4 combinations in total (--fetch and --track)
- Only
--track: Attempt track elements, error out if there is a new ref (since no--fetchsupplied, continue if there is nothing new. - Only
--fetch: Fetch current refs for elements (including related junctions) - they might be cached already. -
--fetchand--track: Previous behaviour of the command with--track, track for new refs if possible and fetch them. - No flags: error out if the current refs are not cached.
- Only
-
bst {workspace-open,workspace-reset} element.bst ..We are interested in the cases whereno_checkoutis NOT used.- Before: Error out if junction(s) are required but not cached yet. Fetch for
elementis always done. Track before fetch can be requested using--track. - After: Now we have 4 combinations in total (--fetch and --track)
- Only
--track: Attempt track elements, error out if there is a new ref (since no--fetchsupplied, continue if there is nothing new. - Only
--fetch: Fetch current refs for elements (including related junctions) - they might be cached already. -
--fetchand--track: Previous behaviour of the command with--track, track for new refs if possible and fetch them. - No flags: error out if the current refs are not cached.
- Only
- Before: Error out if junction(s) are required but not cached yet. Fetch for
You can notice that the original behaviour of workspace commands are almost equivalent to source-bundle, except the latter implicitly fetches junctions where the former complains and terminates.
This merge request, when approved, will close: N/A at the moment.
Edited by Gökçen Nurlu