Joey Hess [Mon, 12 Oct 2015 18:46:28 +0000 (14:46 -0400)]
Avoid unncessary write to the location log when a file is unlocked and then added back with unchanged content.
Implemented with no additional overhead of compares etc.
This is safe to do for presence logs because of their locality of change;
a given repo's presence logs are only ever changed in that repo, or in a
repo that has just been actively changing the content of that repo.
So, we don't need to worry about a split-brain situation where there'd
be disagreement about the location of a key in a repo. And so, it's ok to
not update the timestamp when that's the only change that would be made
due to logging presence info.
Joey Hess [Sun, 11 Oct 2015 17:29:44 +0000 (13:29 -0400)]
use action, not sideAction
sideAction is for things not generally related to the current action being
performed. And, it adds a newline after the side action. This was not the
right thing to use for stuff like "checksum", where doing a checksum is
part of the git annex get process, and indeed we want it to display
"(checksum...) ok"
Joey Hess [Thu, 8 Oct 2015 22:32:31 +0000 (18:32 -0400)]
TrustedCopy is good enough to allow dropping
By definition, a trusted repository is trusted to always have its location
tracking log accurate. Thus, it should never be in a position where content
is being dropped from it concurrently, as that would result in the location
tracking log not being accurate.
Joey Hess [Thu, 8 Oct 2015 22:11:39 +0000 (18:11 -0400)]
require 1 locked copy while dropping from local or a remote
See doc/bugs/concurrent_drop--from_presence_checking_failures.mdwn for
discussion about why 1 locked copy is all we can require, and how this
fixes concurrent dropping bugs.
Note that, since nothing yet generates a VerifiedCopyLock yet, this commit
breaks dropping temporarily.
Joey Hess [Thu, 8 Oct 2015 20:55:11 +0000 (16:55 -0400)]
add VerifiedCopy data type
There should be no behavior changes in this commit, it just adds a more
expressive data type and adjusts code that had been passing around a [UUID]
or sometimes a Maybe Remote to instead use [VerifiedCopy].
Although, since some functions were taking two different [UUID] lists,
there's some potential for me to have gotten it horribly wrong.
Joey Hess [Thu, 8 Oct 2015 18:27:37 +0000 (14:27 -0400)]
add lockContentShared
Also, rename lockContent to lockContentExclusive
inAnnexSafe should perhaps be eliminated, and instead use
`lockContentShared inAnnex`. However, I'm waiting on that, as there are
only 2 call sites for inAnnexSafe and it's fiddly.
Joey Hess [Tue, 6 Oct 2015 21:35:29 +0000 (17:35 -0400)]
add test cases for copy --auto
(Only --from for now, should add --to sometime but I'm on low sleep so this
is the mininal test to catch the reversion just fixed, bad me for doing it
backwards and incompletely.)
Joey Hess [Tue, 6 Oct 2015 21:29:44 +0000 (17:29 -0400)]
copy --auto was checking the wrong repo's preferred content. (--from was checking what --to should, and vice-versa.) Fixed this bug, which was introduced in version 5.20150727.