summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-01-26 14:28:43 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-01-26 14:28:43 -0400
commit4ba917a7a5f67e96c3848ae13c6eaa9eba6300c5 (patch)
tree9a204ed076e46d14ba3dc3a97f7606af10b63de7
parentd059f667d346e1d95a005ea946c41bb69d1dc586 (diff)
Fix nasty reversion in the last release that broke sync --content's handling of many preferred content expressions.
The type checker should have noticed this, but the changes to mapM that make it accept any Traversable hid the fact that it was not being passed a list at all. Thus, what should have returned an empty list most of the time instead returned [""] which was treated as the name of the associated file, with disasterout consequences. When I have time, I should add a test case checking what sync --content drops. I should also consider replacing mapM with one re-specialized to lists.
-rw-r--r--Annex/Drop.hs5
-rw-r--r--Command/Lock.hs2
-rw-r--r--debian/changelog2
-rw-r--r--doc/bugs/wanted___61___present_gets_ignored_in___39__git_annex_sync_--content__39__.mdwn2
-rw-r--r--doc/bugs/wanted___61___present_gets_ignored_in___39__git_annex_sync_--content__39__/comment_1_410adea7a16e77756579556a2270a458._comment11
5 files changed, 20 insertions, 2 deletions
diff --git a/Annex/Drop.hs b/Annex/Drop.hs
index 8a86c0ba8..e5508b2b0 100644
--- a/Annex/Drop.hs
+++ b/Annex/Drop.hs
@@ -8,6 +8,7 @@
module Annex.Drop where
import Annex.Common
+import qualified Annex
import Logs.Trust
import Annex.NumCopies
import Types.Remote (uuid)
@@ -49,7 +50,9 @@ handleDropsFrom :: [UUID] -> [Remote] -> Reason -> Bool -> Key -> AssociatedFile
handleDropsFrom locs rs reason fromhere key afile preverified runner = do
l <- ifM isDirect
( associatedFilesRelative key
- , mapM getTopFilePath <$> Database.Keys.getAssociatedFiles key
+ , do
+ g <- Annex.gitRepo
+ map (`fromTopFilePath` g) <$> Database.Keys.getAssociatedFiles key
)
let fs = if null l then maybeToList afile else l
n <- getcopies fs
diff --git a/Command/Lock.hs b/Command/Lock.hs
index 9611d2407..f002f016a 100644
--- a/Command/Lock.hs
+++ b/Command/Lock.hs
@@ -86,7 +86,7 @@ performNew file key filemodified = do
repopulate obj
| filemodified = modifyContent obj $ do
g <- Annex.gitRepo
- fs <- mapM (`fromTopFilePath` g)
+ fs <- map (`fromTopFilePath` g)
<$> Database.Keys.getAssociatedFiles key
mfile <- firstM (isUnmodified key) fs
liftIO $ nukeFile obj
diff --git a/debian/changelog b/debian/changelog
index 4c52b5ae3..7371a861c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,7 @@
git-annex (6.20160115) UNRELEASED; urgency=medium
+ * Fix nasty reversion in the last release that broke sync --content's
+ handling of many preferred content expressions.
* whereis --json: Urls are now listed inside the remote that claims them,
rather than all together at the end.
* info, add, whereis, find: Support --batch mode.
diff --git a/doc/bugs/wanted___61___present_gets_ignored_in___39__git_annex_sync_--content__39__.mdwn b/doc/bugs/wanted___61___present_gets_ignored_in___39__git_annex_sync_--content__39__.mdwn
index 557b1f13f..470b50722 100644
--- a/doc/bugs/wanted___61___present_gets_ignored_in___39__git_annex_sync_--content__39__.mdwn
+++ b/doc/bugs/wanted___61___present_gets_ignored_in___39__git_annex_sync_--content__39__.mdwn
@@ -16,3 +16,5 @@ git-annex version 6.20160114 on Arch Linux.
### Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders)
This behaviour is relatively recent. Until some time ago everything worked as expected with the expression above.
+
+> [[fixed|done]] --[[Joey]]
diff --git a/doc/bugs/wanted___61___present_gets_ignored_in___39__git_annex_sync_--content__39__/comment_1_410adea7a16e77756579556a2270a458._comment b/doc/bugs/wanted___61___present_gets_ignored_in___39__git_annex_sync_--content__39__/comment_1_410adea7a16e77756579556a2270a458._comment
new file mode 100644
index 000000000..dc4b3dc65
--- /dev/null
+++ b/doc/bugs/wanted___61___present_gets_ignored_in___39__git_annex_sync_--content__39__/comment_1_410adea7a16e77756579556a2270a458._comment
@@ -0,0 +1,11 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2016-01-26T18:22:48Z"
+ content="""
+I think it's worse than that, it lost track of the filename, so
+preferred content expressions with include= or exclude= will also do the
+wrong thing.
+
+Going to have to rush out a release fixing this..
+"""]]