copy --from --to location tracking update
authorJoey Hess <joeyh@joeyh.name>
Mon, 13 Mar 2023 18:50:28 +0000 (14:50 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 13 Mar 2023 18:51:09 +0000 (14:51 -0400)
copy: When --from and --to are combined and the content is already present
on the destination remote, update location tracking as necessary.

Sponsored-by: Dartmouth College's DANDI project
CHANGELOG
Command/Move.hs
doc/bugs/copy_--from_--to_does_not_adjust_avail_info.mdwn
doc/bugs/copy_--from_--to_does_not_adjust_avail_info/comment_1_d6a1dd2e039dcb6dafcf4675b9244617._comment [new file with mode: 0644]

index 649e54f877c19fd67304f23eb812269f29f01245..d61faa42e1264598ee1f2ca61ad6311e9034bc50 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -13,6 +13,9 @@ git-annex (10.20230228) UNRELEASED; urgency=medium
     build.
   * importfeed: Display feed title.
   * init: Support being ran in a repository that has a newline in its path.
+  * copy: When --from and --to are combined and the content is already
+    present on the destination remote, update location tracking as
+    necessary.
 
  -- Joey Hess <id@joeyh.name>  Mon, 27 Feb 2023 12:31:14 -0400
 
index 528e6ce22c002f02535d0545f03d64df12caad22..925b4e45d9ce2cf70adbcdacfad73ad9f6ff736e 100644 (file)
@@ -399,6 +399,9 @@ fromToPerform src dest removewhen key afile = do
                        Right True -> do
                                showAction $ "from " ++ Remote.name src
                                showAction $ "to " ++ Remote.name dest
+                               -- The log may not indicate dest's copy
+                               -- yet, so make sure it does.
+                               logChange key (Remote.uuid dest) InfoPresent
                                -- Drop from src, checking copies including
                                -- the one already in dest.
                                dropfromsrc id
index 1d34ec7cef6e50ef8cd3ea4a2fdfa720039f7c28..40f6d995b700a392289b530823632ea98c4424bd 100644 (file)
@@ -51,3 +51,5 @@ I would expect `copy` to make a record locally that now the content is also on d
 
 [[!meta author=yoh]]
 [[!tag projects/dandi]]
+
+> [[fixed|done]] --[[Joey]]
diff --git a/doc/bugs/copy_--from_--to_does_not_adjust_avail_info/comment_1_d6a1dd2e039dcb6dafcf4675b9244617._comment b/doc/bugs/copy_--from_--to_does_not_adjust_avail_info/comment_1_d6a1dd2e039dcb6dafcf4675b9244617._comment
new file mode 100644 (file)
index 0000000..b5698f0
--- /dev/null
@@ -0,0 +1,11 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2023-03-13T18:34:36Z"
+ content="""
+Aah, I see, this is when the content is present on the --to
+remote, but git-annex is not locally aware of that yet.
+
+And `git-annex copy --to remote` does
+update location tracking in such a case, so --from --to should also.
+"""]]