aboutsummaryrefslogtreecommitdiff
path: root/Command/Mirror.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-07-20 15:22:55 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-07-20 15:23:43 -0400
commit258a3356e6461e0164441bb3a3e202cb9ef889e6 (patch)
treef198f34aaedeffb1af624f918a214527b066175a /Command/Mirror.hs
parente97cd57e1ac72d5a240852704ebaf92716fcad94 (diff)
--branch, stage 2
Show branch:file that is being operated on. I had to make ActionItem a type and not a type class because withKeyOptions' passed two different types of values when using the type class, and I could not get the type checker to accept that.
Diffstat (limited to 'Command/Mirror.hs')
-rw-r--r--Command/Mirror.hs16
1 files changed, 9 insertions, 7 deletions
diff --git a/Command/Mirror.hs b/Command/Mirror.hs
index 8fdba123b..50aca0338 100644
--- a/Command/Mirror.hs
+++ b/Command/Mirror.hs
@@ -47,25 +47,27 @@ seek o = allowConcurrentOutput $
(mirrorFiles o)
start :: MirrorOptions -> FilePath -> Key -> CommandStart
-start o file = startKey o (Just file)
+start o file k = startKey o afile k (mkActionItem afile)
+ where
+ afile = Just file
-startKey :: MirrorOptions -> Maybe FilePath -> Key -> CommandStart
-startKey o afile key = case fromToOptions o of
+startKey :: MirrorOptions -> Maybe FilePath -> Key -> ActionItem -> CommandStart
+startKey o afile key ai = case fromToOptions o of
ToRemote r -> ifM (inAnnex key)
- ( Command.Move.toStart False afile key =<< getParsed r
+ ( Command.Move.toStart False afile key ai =<< getParsed r
, do
numcopies <- getnumcopies
- Command.Drop.startRemote afile numcopies key =<< getParsed r
+ Command.Drop.startRemote afile ai numcopies key =<< getParsed r
)
FromRemote r -> do
haskey <- flip Remote.hasKey key =<< getParsed r
case haskey of
Left _ -> stop
- Right True -> Command.Get.start' (return True) Nothing key afile
+ Right True -> Command.Get.start' (return True) Nothing key afile ai
Right False -> ifM (inAnnex key)
( do
numcopies <- getnumcopies
- Command.Drop.startLocal afile numcopies key []
+ Command.Drop.startLocal afile ai numcopies key []
, stop
)
where