diff options
author | Joey Hess <joey@kitenet.net> | 2011-10-27 14:04:18 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-10-27 14:55:06 -0400 |
commit | 373cad993d9f12a9dfb7473fdba78e92af6eff99 (patch) | |
tree | b061c40a436ef29ba6a4ced4ea7630064af4fde5 /Remote | |
parent | 2eefc580703199d3ecca58d453f07747b565d476 (diff) |
Sped up some operations on remotes that are on the same host.
Specifically, disabled trying to update the git-annex branch on the remote,
since that data is never used by operations that act on such remotes.
Also, when copying content to such a remote, skip committing the presence
information changes to its git-annex branch. Leaving it in the journal there
is ok: Any command run on the remote that needs the info will flush the
journal.
This may partially solve this bug:
http://git-annex.branchable.com/bugs/fails_to_handle_lot_of_files/
Although I still see unreaped git processes piling up when doing a copy --to.
Diffstat (limited to 'Remote')
-rw-r--r-- | Remote/Git.hs | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/Remote/Git.hs b/Remote/Git.hs index 5d31770a2..e77b00572 100644 --- a/Remote/Git.hs +++ b/Remote/Git.hs @@ -19,6 +19,7 @@ import qualified Git import qualified Annex import Annex.UUID import qualified Annex.Content +import qualified Annex.Branch import qualified Utility.Url as Url import Utility.TempFile import Config @@ -133,7 +134,7 @@ inAnnex r key | Git.repoIsUrl r = checkremote | otherwise = safely checklocal where - checklocal = onLocal r (Annex.Content.inAnnex key) + checklocal = onLocal r $ Annex.Content.inAnnex key checkremote = do showAction $ "checking " ++ Git.repoDescribe r inannex <- onRemote r (boolSystem, False) "inannex" @@ -147,7 +148,11 @@ inAnnex r key onLocal :: Git.Repo -> Annex a -> IO a onLocal r a = do annex <- Annex.new r - Annex.eval annex a + Annex.eval annex $ do + -- No need to update the branch; its data is not used + -- for anything onLocal is used to do. + Annex.Branch.disableUpdate + a keyUrl :: Git.Repo -> Key -> String keyUrl r key = Git.repoLocation r ++ "/" ++ annexLocation key @@ -175,11 +180,8 @@ copyToRemote r key g <- gitRepo let keysrc = gitAnnexLocation g key -- run copy from perspective of remote - liftIO $ onLocal r $ do - ok <- Annex.Content.getViaTmp key $ - rsyncOrCopyFile r keysrc - Annex.Content.saveState - return ok + liftIO $ onLocal r $ Annex.Content.getViaTmp key $ + rsyncOrCopyFile r keysrc | Git.repoIsSsh r = do g <- gitRepo let keysrc = gitAnnexLocation g key |