copy: Update location log when no copy was performed, if the location log was out of date.
This commit is contained in:
parent
7df2861d67
commit
3b92c279e8
2 changed files with 18 additions and 13 deletions
|
@ -79,9 +79,7 @@ toPerform dest move key file = moveLock move key $ do
|
||||||
fast <- Annex.getState Annex.fast
|
fast <- Annex.getState Annex.fast
|
||||||
let fastcheck = fast && not move && not (Remote.hasKeyCheap dest)
|
let fastcheck = fast && not move && not (Remote.hasKeyCheap dest)
|
||||||
isthere <- if fastcheck
|
isthere <- if fastcheck
|
||||||
then do
|
then Right <$> expectedpresent
|
||||||
remotes <- Remote.keyPossibilities key
|
|
||||||
return $ Right $ dest `elem` remotes
|
|
||||||
else Remote.hasKey dest key
|
else Remote.hasKey dest key
|
||||||
case isthere of
|
case isthere of
|
||||||
Left err -> do
|
Left err -> do
|
||||||
|
@ -92,21 +90,26 @@ toPerform dest move key file = moveLock move key $ do
|
||||||
ok <- upload (Remote.uuid dest) key (Just file) noRetry $
|
ok <- upload (Remote.uuid dest) key (Just file) noRetry $
|
||||||
Remote.storeKey dest key (Just file)
|
Remote.storeKey dest key (Just file)
|
||||||
if ok
|
if ok
|
||||||
then finish True
|
then do
|
||||||
|
Remote.logStatus dest key InfoPresent
|
||||||
|
finish
|
||||||
else do
|
else do
|
||||||
when fastcheck $
|
when fastcheck $
|
||||||
warning "This could have failed because --fast is enabled."
|
warning "This could have failed because --fast is enabled."
|
||||||
stop
|
stop
|
||||||
Right True -> finish False
|
Right True -> do
|
||||||
|
unlessM expectedpresent $
|
||||||
|
Remote.logStatus dest key InfoPresent
|
||||||
|
finish
|
||||||
where
|
where
|
||||||
finish remotechanged = do
|
finish
|
||||||
when remotechanged $
|
| move = do
|
||||||
Remote.logStatus dest key InfoPresent
|
removeAnnex key
|
||||||
if move
|
next $ Command.Drop.cleanupLocal key
|
||||||
then do
|
| otherwise = next $ return True
|
||||||
removeAnnex key
|
expectedpresent = do
|
||||||
next $ Command.Drop.cleanupLocal key
|
remotes <- Remote.keyPossibilities key
|
||||||
else next $ return True
|
return $ dest `elem` remotes
|
||||||
|
|
||||||
{- Moves (or copies) the content of an annexed file from a remote
|
{- Moves (or copies) the content of an annexed file from a remote
|
||||||
- to the current repository.
|
- to the current repository.
|
||||||
|
|
2
debian/changelog
vendored
2
debian/changelog
vendored
|
@ -19,6 +19,8 @@ git-annex (3.20130217) UNRELEASED; urgency=low
|
||||||
* Fix a reversion in matching globs introduced in the last release,
|
* Fix a reversion in matching globs introduced in the last release,
|
||||||
where "*" did not match files inside subdirectories. No longer uses
|
where "*" did not match files inside subdirectories. No longer uses
|
||||||
the Glob library.
|
the Glob library.
|
||||||
|
* copy: Update location log when no copy was performed, if the location
|
||||||
|
log was out of date.
|
||||||
|
|
||||||
-- Joey Hess <joeyh@debian.org> Sun, 17 Feb 2013 16:42:16 -0400
|
-- Joey Hess <joeyh@debian.org> Sun, 17 Feb 2013 16:42:16 -0400
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue