2011-06-22 22:46:45 +00:00
|
|
|
{- git-annex command
|
|
|
|
-
|
2013-07-03 19:42:56 +00:00
|
|
|
- Copyright 2011, 2013 Joey Hess <joey@kitenet.net>
|
2011-06-22 22:46:45 +00:00
|
|
|
-
|
|
|
|
- Licensed under the GNU GPL version 3 or higher.
|
|
|
|
-}
|
|
|
|
|
|
|
|
module Command.Merge where
|
|
|
|
|
2011-10-05 20:02:51 +00:00
|
|
|
import Common.Annex
|
2011-06-22 22:46:45 +00:00
|
|
|
import Command
|
2011-10-04 04:40:47 +00:00
|
|
|
import qualified Annex.Branch
|
2013-07-03 19:42:56 +00:00
|
|
|
import qualified Git.Branch
|
2013-09-13 18:55:55 +00:00
|
|
|
import Command.Sync (prepMerge, mergeLocal)
|
2011-06-22 22:46:45 +00:00
|
|
|
|
2011-10-29 19:19:05 +00:00
|
|
|
def :: [Command]
|
2013-03-24 22:28:21 +00:00
|
|
|
def = [command "merge" paramNothing seek SectionMaintenance
|
2013-07-03 19:42:56 +00:00
|
|
|
"automatically merge changes from remotes"]
|
2011-06-22 22:46:45 +00:00
|
|
|
|
|
|
|
seek :: [CommandSeek]
|
2013-07-03 19:42:56 +00:00
|
|
|
seek =
|
|
|
|
[ withNothing mergeBranch
|
|
|
|
, withNothing mergeSynced
|
|
|
|
]
|
2011-06-22 22:46:45 +00:00
|
|
|
|
2013-07-03 19:42:56 +00:00
|
|
|
mergeBranch :: CommandStart
|
|
|
|
mergeBranch = do
|
|
|
|
showStart "merge" "git-annex"
|
|
|
|
next $ do
|
|
|
|
Annex.Branch.update
|
|
|
|
-- commit explicitly, in case no remote branches were merged
|
|
|
|
Annex.Branch.commit "update"
|
|
|
|
next $ return True
|
2011-06-22 22:46:45 +00:00
|
|
|
|
2013-07-03 19:42:56 +00:00
|
|
|
mergeSynced :: CommandStart
|
|
|
|
mergeSynced = do
|
2013-09-13 18:55:55 +00:00
|
|
|
prepMerge
|
2013-11-02 19:29:38 +00:00
|
|
|
mergeLocal =<< inRepo Git.Branch.current
|