git-annex/Command
Joey Hess 53882ab4a7
make WorkerStage an open type
Rather than limiting it to PerformStage and CleanupStage, this opens it
up so any number of stages can be added as needed by commands.

Each concurrent command has a set of stages that it uses, and only
transitions between those can block waiting for a free slot in the
worker pool. Calling enteringStage for some other stage does not block,
and has very little overhead.

Note that while before the Annex state was duplicated on the first call
to commandAction, this now happens earlier, in startConcurrency.
That means that seek stage actions should that use startConcurrency
and then modify Annex state won't modify the state of worker threads
they then start. I audited all of them, and only Command.Seek
did so; prepMerge changes the working directory and so has to come
before startConcurrency.

Also, the remote list is built before duplicating the state, which means
that it gets built earlier now than it used to. This would only have an
effect of making commands that end up not needing to perform any actions
unncessary build the remote list (only when they're run with concurrency
enable), but that's a minor overhead compared to commands seeking
through the work tree and determining they don't need to do anything.
2019-06-19 13:05:03 -04:00
..
Add.hs make WorkerStage an open type 2019-06-19 13:05:03 -04:00
AddUnused.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
AddUrl.hs make WorkerStage an open type 2019-06-19 13:05:03 -04:00
Adjust.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
Assistant.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Benchmark.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
CalcKey.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
CheckPresentKey.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Commit.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
Config.hs finish CommandStart transition 2019-06-12 13:24:01 -04:00
ConfigList.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
ContentLocation.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Copy.hs make WorkerStage an open type 2019-06-19 13:05:03 -04:00
Dead.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
Describe.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
DiffDriver.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Direct.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
Drop.hs make WorkerStage an open type 2019-06-19 13:05:03 -04:00
DropKey.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
DropUnused.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
EnableRemote.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
EnableTor.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
ExamineKey.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Expire.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
Export.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
Find.hs finish CommandStart transition 2019-06-12 13:24:01 -04:00
FindRef.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Fix.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
Forget.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
FromKey.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
Fsck.hs make WorkerStage an open type 2019-06-19 13:05:03 -04:00
FuzzTest.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
GCryptSetup.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
Get.hs make WorkerStage an open type 2019-06-19 13:05:03 -04:00
Group.hs finish CommandStart transition 2019-06-12 13:24:01 -04:00
GroupWanted.hs finish CommandStart transition 2019-06-12 13:24:01 -04:00
Help.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Import.hs make WorkerStage an open type 2019-06-19 13:05:03 -04:00
ImportFeed.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
InAnnex.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Indirect.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
Info.hs add Key to all ActionItem constructors 2019-06-06 12:53:24 -04:00
Init.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
InitRemote.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
Inprogress.hs finish CommandStart transition 2019-06-12 13:24:01 -04:00
List.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Lock.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
LockContent.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Log.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
LookupKey.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Map.hs add startingNoMessage 2019-06-12 14:11:23 -04:00
MatchExpression.hs support standard and groupwanted in keyless mode 2019-05-14 14:59:03 -04:00
Merge.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
MetaData.hs finish CommandStart transition 2019-06-12 13:24:01 -04:00
Migrate.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
Mirror.hs make WorkerStage an open type 2019-06-19 13:05:03 -04:00
Move.hs make WorkerStage an open type 2019-06-19 13:05:03 -04:00
Multicast.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
NotifyChanges.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
NumCopies.hs finish CommandStart transition 2019-06-12 13:24:01 -04:00
P2P.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
P2PStdIO.hs finish CommandStart transition 2019-06-12 13:24:01 -04:00
PostReceive.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
PreCommit.hs finish CommandStart transition 2019-06-12 13:24:01 -04:00
Proxy.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
ReadPresentKey.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
RecvKey.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
RegisterUrl.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
Reinit.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
Reinject.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
ReKey.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
RemoteDaemon.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
RenameRemote.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
Repair.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
Required.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
ResolveMerge.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
RmUrl.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
Schedule.hs finish CommandStart transition 2019-06-12 13:24:01 -04:00
Semitrust.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
SendKey.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
SetKey.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
SetPresentKey.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
Smudge.hs avoid ingest lockdown file escaping the withOtherTmp call 2019-05-07 13:04:57 -04:00
Status.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Sync.hs make WorkerStage an open type 2019-06-19 13:05:03 -04:00
Test.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
TestRemote.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
TransferInfo.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
TransferKey.hs finish CommandStart transition 2019-06-12 13:24:01 -04:00
TransferKeys.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Trust.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
Unannex.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
Undo.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
Ungroup.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
Uninit.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Unlock.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
Untrust.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Unused.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
Upgrade.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
VAdd.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
VCycle.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
Version.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
VFilter.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
Vicfg.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
View.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
VPop.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00
Wanted.hs finish CommandStart transition 2019-06-12 13:24:01 -04:00
Watch.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
WebApp.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Whereis.hs make CommandStart return a StartMessage 2019-06-06 17:13:54 -04:00