git-annex/Command
Joey Hess 428c91606b
include locked files in the keys database associated files
Before only unlocked files were included.

The initial scan now scans for locked as well as unlocked files. This
does mean it gets a little bit slower, although I optimised it as well
as I think it can be.

reconcileStaged changed to diff from the current index to the tree of
the previous index. This lets it handle deletions as well, removing
associated files for both locked and unlocked files, which did not
always happen before.

On upgrade, there will be no recorded previous tree, so it will diff
from the empty tree to current index, and so will fully populate the
associated files, as well as removing any stale associated files
that were present due to them not being removed before.

reconcileStaged now does a bit more work. Most of the time, this will
just be due to running more often, after some change is made to the
index, and since there will be few changes since the last time, it will
not be a noticable overhead. What may turn out to be a noticable
slowdown is after changing to a branch, it has to go through the diff
from the previous index to the new one, and if there are lots of
changes, that could take a long time. Also, after adding a lot of files,
or deleting a lot of files, or moving a large subdirectory, etc.

Command.Lock used removeAssociatedFile, but now that's wrong because a
newly locked file still needs to have its associated file tracked.

Command.Rekey used removeAssociatedFile when the file was unlocked.
It could remove it also when it's locked, but it is not really
necessary, because it changes the index, and so the next time git-annex
run and accesses the keys db, reconcileStaged will run and update it.

There are probably several other places that use addAssociatedFile and
don't need to any more for similar reasons. But there's no harm in
keeping them, and it probably is a good idea to, if only to support
mixing this with older versions of git-annex.

However, mixing this and older versions does risk reconcileStaged not
running, if the older version already ran it on a given index state. So
it's not a good idea to mix versions. This problem could be dealt with
by changing the name of the gitAnnexKeysDbIndexCache, but that would
leave the old file dangling, or it would need to keep trying to remove
it.
2021-05-21 16:24:37 -04:00
..
Add.hs remove inode cache in unannex 2021-05-12 11:09:38 -04:00
AddUnused.hs more RawFilePath conversion 2020-11-03 10:11:04 -04:00
AddUrl.hs suggest when user may want annex.stalldetection 2021-02-03 15:57:19 -04:00
Adjust.hs rename to --unlock-present and better reverse adjusting 2020-11-13 14:56:43 -04:00
Assistant.hs add searchPathContents 2021-02-02 19:06:15 -04:00
Benchmark.hs improve benchmark --databases 2019-11-21 17:25:20 -04:00
CalcKey.hs add SeekInput (not yet used) 2020-09-15 15:41:13 -04:00
CheckPresentKey.hs add SeekInput (not yet used) 2020-09-15 15:41:13 -04:00
Commit.hs use Branch.name instead of hard coding the branch name 2020-09-15 15:47:22 -04:00
Config.hs add "input" field to json output 2020-09-15 16:22:44 -04:00
ConfigList.hs all commands building except for assistant 2019-12-05 14:41:18 -04:00
ContentLocation.hs add SeekInput (not yet used) 2020-09-15 15:41:13 -04:00
Copy.hs more RawFilePath conversion 2020-11-03 10:11:04 -04:00
Dead.hs add SeekInput (not yet used) 2020-09-15 15:41:13 -04:00
Describe.hs add SeekInput (not yet used) 2020-09-15 15:41:13 -04:00
DiffDriver.hs diffdriver: Support unlocked files 2021-04-08 14:32:09 -04:00
Direct.hs Automatically convert direct mode repositories to v7 with adjusted unlocked branches 2019-08-26 15:05:25 -04:00
Drop.hs use fastDebug everywhere it can be used 2021-04-06 15:41:24 -04:00
DropKey.hs add SeekInput (not yet used) 2020-09-15 15:41:13 -04:00
DropUnused.hs mincopies 2021-01-06 14:15:19 -04:00
EnableRemote.hs cache remote.log 2020-09-22 13:52:26 -04:00
EnableTor.hs add SeekInput (not yet used) 2020-09-15 15:41:13 -04:00
ExamineKey.hs examinekey: Added a "file" format variable 2020-11-16 09:59:11 -04:00
Expire.hs add SeekInput (not yet used) 2020-09-15 15:41:13 -04:00
Export.hs add git ls-tree --long parser 2021-03-23 12:47:00 -04:00
FilterBranch.hs decided not to include export/import trees 2021-05-17 14:12:15 -04:00
Find.hs examinekey: Added a "file" format variable 2020-11-16 09:59:11 -04:00
FindRef.hs Ref ByteString conversion done 2020-04-07 17:41:09 -04:00
Fix.hs Git.Queue: allow providing git common options like -c 2021-01-04 12:51:55 -04:00
Forget.hs start implementing hidden git-annex repositories 2021-04-20 15:04:53 -04:00
FromKey.hs fromkey: create directory for pointer files too 2021-05-07 11:10:06 -04:00
Fsck.hs fsck: avoid redundant checksum when transfer is Verified 2021-04-14 13:22:54 -04:00
FuzzTest.hs finish fixing removeLink on windows 2020-11-24 13:20:44 -04:00
GCryptSetup.hs add SeekInput (not yet used) 2020-09-15 15:41:13 -04:00
Get.hs get: Improve output when failing to get a file fails 2021-01-29 15:11:19 -04:00
Group.hs add SeekInput (not yet used) 2020-09-15 15:41:13 -04:00
GroupWanted.hs add SeekInput (not yet used) 2020-09-15 15:41:13 -04:00
Help.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Import.hs export --json: Fill in the file field 2021-03-12 14:11:31 -04:00
ImportFeed.hs importfeed: fix bug while also speeding up 12x! 2021-04-23 12:36:56 -04:00
InAnnex.hs add SeekInput (not yet used) 2020-09-15 15:41:13 -04:00
Indirect.hs Automatically convert direct mode repositories to v7 with adjusted unlocked branches 2019-08-26 15:05:25 -04:00
Info.hs add git ls-tree --long parser 2021-03-23 12:47:00 -04:00
Init.hs add SeekInput (not yet used) 2020-09-15 15:41:13 -04:00
InitRemote.hs initremote --private 2021-04-23 14:47:46 -04:00
Inprogress.hs more RawFilePath conversion 2020-11-02 16:31:28 -04:00
List.hs add "input" field to json output 2020-09-15 16:22:44 -04:00
Lock.hs include locked files in the keys database associated files 2021-05-21 16:24:37 -04:00
LockContent.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Log.hs more RawFilePath conversion 2020-11-02 16:31:28 -04:00
LookupKey.hs add SeekInput (not yet used) 2020-09-15 15:41:13 -04:00
Map.hs avoid making absolute git remote path relative 2021-02-08 13:18:01 -04:00
MatchExpression.hs split ProvidedInfo and UserProvidedInfo 2020-09-28 12:12:38 -04:00
Merge.hs use Branch.name instead of hard coding the branch name 2020-09-15 15:47:22 -04:00
MetaData.hs generate more compact git-annex branch for imports 2020-12-23 15:25:16 -04:00
Migrate.hs include locked files in the keys database associated files 2021-05-21 16:24:37 -04:00
MinCopies.hs mincopies 2021-01-06 14:15:19 -04:00
Mirror.hs mincopies 2021-01-06 14:15:19 -04:00
Move.hs use fastDebug everywhere it can be used 2021-04-06 15:41:24 -04:00
Multicast.hs Command/Multicast: use proper hyphen 2021-05-04 05:44:31 +02:00
NotifyChanges.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
NumCopies.hs mincopies 2021-01-06 14:15:19 -04:00
P2P.hs finish fixing removeLink on windows 2020-11-24 13:20:44 -04:00
P2PStdIO.hs finish CommandStart transition 2019-06-12 13:24:01 -04:00
PostReceive.hs sync --only-annex and annex.synconlyannex 2020-02-17 16:33:10 -04:00
PreCommit.hs add SeekInput (not yet used) 2020-09-15 15:41:13 -04:00
Proxy.hs Automatically convert direct mode repositories to v7 with adjusted unlocked branches 2019-08-26 15:05:25 -04:00
ReadPresentKey.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
RecvKey.hs make getViaTmpFrom no longer update location log 2020-12-11 11:50:13 -04:00
RegisterUrl.hs unregisterurl: New command 2021-03-01 14:28:24 -04:00
Reinit.hs add SeekInput (not yet used) 2020-09-15 15:41:13 -04:00
Reinject.hs reinject: Error out when run on a file that is not annexed 2021-05-07 13:31:03 -04:00
ReKey.hs include locked files in the keys database associated files 2021-05-21 16:24:37 -04:00
RemoteDaemon.hs assistant: Fix a crash on startup by avoiding using forkProcess 2021-05-12 15:08:03 -04:00
RenameRemote.hs cache remote.log 2020-09-22 13:52:26 -04:00
Repair.hs finished this stage of the RawFilePath conversion 2020-11-06 14:10:58 -04:00
Required.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
ResolveMerge.hs add SeekInput (not yet used) 2020-09-15 15:41:13 -04:00
RmUrl.hs rmurl: remove all forms of an url, no matter what the downloader is set to 2021-03-22 12:09:15 -04:00
Schedule.hs add SeekInput (not yet used) 2020-09-15 15:41:13 -04:00
Semitrust.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
SendKey.hs use fastDebug everywhere it can be used 2021-04-06 15:41:24 -04:00
SetKey.hs annex.adjustedbranchrefresh 2020-11-16 14:27:28 -04:00
SetPresentKey.hs add SeekInput (not yet used) 2020-09-15 15:41:13 -04:00
Smudge.hs smudge: check for known annexed inodes before checking annex.largefiles 2021-05-10 13:20:10 -04:00
Status.hs more RawFilePath conversion 2020-11-02 16:31:28 -04:00
Sync.hs avoid importing deleting submodule 2021-03-12 13:31:21 -04:00
Test.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
TestRemote.hs Revert "reorder another test" 2021-04-23 01:01:29 -04:00
TransferInfo.hs more RawFilePath conversion 2020-11-02 16:31:28 -04:00
TransferKey.hs suggest when user may want annex.stalldetection 2021-02-03 15:57:19 -04:00
TransferKeys.hs suggest when user may want annex.stalldetection 2021-02-03 15:57:19 -04:00
Transferrer.hs suggest when user may want annex.stalldetection 2021-02-03 15:57:19 -04:00
Trust.hs fix format of message 2021-01-11 13:14:09 -04:00
Unannex.hs remove inode cache in unannex 2021-05-12 11:09:38 -04:00
Undo.hs finished this stage of the RawFilePath conversion 2020-11-04 14:20:37 -04:00
Ungroup.hs add SeekInput (not yet used) 2020-09-15 15:41:13 -04:00
Uninit.hs uninit: Fix a small bug that left a lock file in .git/annex 2021-03-01 13:05:47 -04:00
Unlock.hs more RawFilePath conversion 2020-10-30 15:55:59 -04:00
UnregisterUrl.hs unregisterurl: remove all forms of an url, no matter what the downloader is set to 2021-03-22 12:17:17 -04:00
Untrust.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Unused.hs update comment 2021-03-11 12:03:36 -04:00
Upgrade.hs switch to Haskell2010 2020-10-19 11:26:16 -04:00
VAdd.hs add SeekInput (not yet used) 2020-09-15 15:41:13 -04:00
VCycle.hs add SeekInput (not yet used) 2020-09-15 15:41:13 -04:00
Version.hs external backends wip 2020-07-29 15:23:18 -04:00
VFilter.hs add SeekInput (not yet used) 2020-09-15 15:41:13 -04:00
Vicfg.hs finish fixing removeLink on windows 2020-11-24 13:20:44 -04:00
View.hs more RawFilePath conversion 2020-10-30 15:55:59 -04:00
VPop.hs add SeekInput (not yet used) 2020-09-15 15:41:13 -04:00
Wanted.hs add SeekInput (not yet used) 2020-09-15 15:41:13 -04:00
Watch.hs remotedaemon: Don't list --stop in help since it's not supported. 2019-09-30 14:40:46 -04:00
WebApp.hs finished this stage of the RawFilePath conversion 2020-11-04 14:20:37 -04:00
Whereis.hs whereis: Don't include yt: prefix when showing url to content retrieved with youtube-dl 2021-03-22 19:56:24 -04:00