aboutsummaryrefslogtreecommitdiff
path: root/Annex
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-10-27 14:04:18 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-10-27 14:55:06 -0400
commit373cad993d9f12a9dfb7473fdba78e92af6eff99 (patch)
treeb061c40a436ef29ba6a4ced4ea7630064af4fde5 /Annex
parent2eefc580703199d3ecca58d453f07747b565d476 (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 'Annex')
-rw-r--r--Annex/Branch.hs12
1 files changed, 10 insertions, 2 deletions
diff --git a/Annex/Branch.hs b/Annex/Branch.hs
index aea0d2bff..24da8120c 100644
--- a/Annex/Branch.hs
+++ b/Annex/Branch.hs
@@ -8,6 +8,7 @@
module Annex.Branch (
create,
update,
+ disableUpdate,
get,
change,
commit,
@@ -136,7 +137,7 @@ update = onceonly $ do
c <- filterM changedbranch =<< siblingBranches
let (refs, branches) = unzip c
unless (not dirty && null refs) $ withIndex $ lockJournal $ do
- when dirty $ stageJournalFiles
+ when dirty stageJournalFiles
g <- gitRepo
unless (null branches) $ do
showSideAction $ "merging " ++
@@ -164,8 +165,15 @@ update = onceonly $ do
return $ not $ L.null diffs
onceonly a = unlessM (branchUpdated <$> getState) $ do
r <- a
- Annex.changeState setupdated
+ disableUpdate
return r
+
+{- Avoids updating the branch. A useful optimisation when the branc
+ - is known to have not changed, or git-annex won't be relying on info
+ - from it. -}
+disableUpdate :: Annex ()
+disableUpdate = Annex.changeState setupdated
+ where
setupdated s = s { Annex.branchstate = new }
where
new = old { branchUpdated = True }