Optimized copy --from and get --from to avoid checking the location log for files that are already present.
This can be a significant speedup when running in large trees that are only missing a few files; it makes copy --from just as fast as get.
This commit is contained in:
parent
49d2177d51
commit
2de1e2c2ce
2 changed files with 16 additions and 8 deletions
|
@ -110,14 +110,20 @@ toPerform dest move key = moveLock move key $ do
|
||||||
- from the remote.
|
- from the remote.
|
||||||
-}
|
-}
|
||||||
fromStart :: Remote.Remote Annex -> Bool -> FilePath -> CommandStart
|
fromStart :: Remote.Remote Annex -> Bool -> FilePath -> CommandStart
|
||||||
fromStart src move file = isAnnexed file $ \(key, _) -> do
|
fromStart src move file
|
||||||
u <- getUUID
|
| move == True = isAnnexed file $ \(key, _) -> go key
|
||||||
remotes <- Remote.keyPossibilities key
|
| otherwise = isAnnexed file $ \(key, _) -> do
|
||||||
if u == Remote.uuid src || not (any (== src) remotes)
|
ishere <- inAnnex key
|
||||||
then stop
|
if ishere then stop else go key
|
||||||
else do
|
where
|
||||||
showMoveAction move file
|
go key = do
|
||||||
next $ fromPerform src move key
|
u <- getUUID
|
||||||
|
remotes <- Remote.keyPossibilities key
|
||||||
|
if u == Remote.uuid src || not (any (== src) remotes)
|
||||||
|
then stop
|
||||||
|
else do
|
||||||
|
showMoveAction move file
|
||||||
|
next $ fromPerform src move key
|
||||||
fromPerform :: Remote.Remote Annex -> Bool -> Key -> CommandPerform
|
fromPerform :: Remote.Remote Annex -> Bool -> Key -> CommandPerform
|
||||||
fromPerform src move key = moveLock move key $ do
|
fromPerform src move key = moveLock move key $ do
|
||||||
ishere <- inAnnex key
|
ishere <- inAnnex key
|
||||||
|
|
2
debian/changelog
vendored
2
debian/changelog
vendored
|
@ -3,6 +3,8 @@ git-annex (3.20111108) UNRELEASED; urgency=low
|
||||||
* Handle a case where an annexed file is moved into a gitignored directory,
|
* Handle a case where an annexed file is moved into a gitignored directory,
|
||||||
by having fix --force add its change.
|
by having fix --force add its change.
|
||||||
* Avoid cyclic drop problems.
|
* Avoid cyclic drop problems.
|
||||||
|
* Optimized copy --from and get --from to avoid checking the location log
|
||||||
|
for files that are already present.
|
||||||
|
|
||||||
-- Joey Hess <joeyh@debian.org> Mon, 07 Nov 2011 18:08:42 -0400
|
-- Joey Hess <joeyh@debian.org> Mon, 07 Nov 2011 18:08:42 -0400
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue