import qualified Git
import qualified Git.Command
import qualified Git.Ref
-import qualified Git.Merge
import qualified Remote
import qualified Types.Remote as Remote
import qualified Remote.List as Remote
)
haddiverged <- liftAnnex Annex.Branch.forceUpdate
forM_ normalremotes $ \r ->
- liftAnnex $ Command.Sync.mergeRemote r currentbranch mergeConfig
+ liftAnnex $ Command.Sync.mergeRemote r currentbranch Command.Sync.mergeConfig
u <- liftAnnex getUUID
forM_ xmppremotes $ \r ->
sendNetMessage $ Pushing (getXMPPClientID r) (PushRequest u)
return (catMaybes failed, haddiverged)
-mergeConfig :: [Git.Merge.MergeConfig]
-mergeConfig =
- [ Git.Merge.MergeNonInteractive
- -- Pairing involves merging unrelated histories
- , Git.Merge.MergeUnrelatedHistories
- ]
-
{- Start syncing a remote, using a background thread. -}
syncRemote :: Remote -> Assistant ()
syncRemote remote = do
import Assistant.BranchChange
import Assistant.DaemonStatus
import Assistant.ScanRemotes
-import Assistant.Sync
import Utility.DirWatcher
import Utility.DirWatcher.Types
import qualified Annex.Branch
, "into", Git.fromRef b
]
void $ liftAnnex $ Command.Sync.merge
- currbranch mergeConfig
+ currbranch Command.Sync.mergeConfig
Git.Branch.AutomaticCommit
changedbranch
mergecurrent _ = noop
if so, either use stack to build, or run cabal with
--constraint='persistent ==2.2.4.1'
Hopefully this mess with esqueleto will be resolved soon.
+ * sync: Pass --allow-unrelated-histories to git merge when used with git
+ git 2.9.0 or newer. This makes merging a remote into a freshly created
+ direct mode repository work the same as it works in indirect mode.
-- Joey Hess <id@joeyh.name> Tue, 15 Nov 2016 11:15:27 -0400
prepMerge = Annex.changeDirectory =<< fromRepo Git.repoPath
mergeConfig :: [Git.Merge.MergeConfig]
-mergeConfig = [Git.Merge.MergeNonInteractive]
+mergeConfig =
+ [ Git.Merge.MergeNonInteractive
+ -- In several situations, unrelated histories should be merged
+ -- together. This includes pairing in the assistant etc.
+ , Git.Merge.MergeUnrelatedHistories
+ ]
merge :: CurrBranch -> [Git.Merge.MergeConfig] -> Git.Branch.CommitMode -> Git.Branch -> Annex Bool
merge (Just b, Just adj) mergeconfig commitmode tomerge =