Generations -> profile versions

This commit is contained in:
Eelco Dolstra 2021-09-14 19:57:45 +02:00
parent 229ad612b8
commit f359b9981b
3 changed files with 9 additions and 9 deletions

View file

@ -126,9 +126,9 @@ void deleteGeneration(const Path & profile, GenerationNumber gen)
static void deleteGeneration2(const Path & profile, GenerationNumber gen, bool dryRun) static void deleteGeneration2(const Path & profile, GenerationNumber gen, bool dryRun)
{ {
if (dryRun) if (dryRun)
printInfo(format("would remove generation %1%") % gen); printInfo(format("would remove profile version %1%") % gen);
else { else {
printInfo(format("removing generation %1%") % gen); printInfo(format("removing profile version %1%") % gen);
deleteGeneration(profile, gen); deleteGeneration(profile, gen);
} }
} }
@ -142,7 +142,7 @@ void deleteGenerations(const Path & profile, const std::set<GenerationNumber> &
auto [gens, curGen] = findGenerations(profile); auto [gens, curGen] = findGenerations(profile);
if (gensToDelete.count(*curGen)) if (gensToDelete.count(*curGen))
throw Error("cannot delete current generation of profile %1%'", profile); throw Error("cannot delete current version of profile %1%'", profile);
for (auto & i : gens) { for (auto & i : gens) {
if (!gensToDelete.count(i.number)) continue; if (!gensToDelete.count(i.number)) continue;
@ -254,12 +254,12 @@ void switchGeneration(
if (!dst) { if (!dst) {
if (dstGen) if (dstGen)
throw Error("generation %1% does not exist", *dstGen); throw Error("profile version %1% does not exist", *dstGen);
else else
throw Error("no generation older than the current (%1%) exists", curGen.value_or(0)); throw Error("no profile version older than the current (%1%) exists", curGen.value_or(0));
} }
notice("switching from generation %d to %d", curGen.value_or(0), dst->number); notice("switching profile from version %d to %d", curGen.value_or(0), dst->number);
if (dryRun) return; if (dryRun) return;

View file

@ -6,14 +6,14 @@ R""(
```console ```console
# nix profile rollback # nix profile rollback
switching from generation 519 to 518 switching profile from version 519 to 518
``` ```
* Switch your default profile to version 510: * Switch your default profile to version 510:
```console ```console
# nix profile rollback --to 510 # nix profile rollback --to 510
switching from generation 518 to 510 switching profile from version 518 to 510
``` ```
# Description # Description

View file

@ -559,7 +559,7 @@ struct CmdProfileRollback : virtual StoreCommand, MixDefaultProfile, MixDryRun
std::string description() override std::string description() override
{ {
return "roll back to the previous version or a specified version of this profile"; return "roll back to the previous version or a specified version of a profile";
} }
std::string doc() override std::string doc() override