diff options
Diffstat (limited to 'Command/Export.hs')
-rw-r--r-- | Command/Export.hs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Command/Export.hs b/Command/Export.hs index 02c64eadf..81013ad47 100644 --- a/Command/Export.hs +++ b/Command/Export.hs @@ -28,6 +28,7 @@ import Logs.Location import Logs.Export import Database.Export import Messages.Progress +import Config import Utility.Tmp import qualified Data.ByteString.Lazy as L @@ -41,16 +42,22 @@ cmd = command "export" SectionCommon data ExportOptions = ExportOptions { exportTreeish :: Git.Ref , exportRemote :: DeferredParse Remote + , exportTracking :: Bool } optParser :: CmdParamsDesc -> Parser ExportOptions optParser _ = ExportOptions <$> (Git.Ref <$> parsetreeish) <*> (parseRemoteOption <$> parseToOption) + <*> parsetracking where parsetreeish = argument str ( metavar paramTreeish ) + parsetracking = switch + ( long "tracking" + <> help ("track changes to the " ++ paramTreeish) + ) -- To handle renames which swap files, the exported file is first renamed -- to a stable temporary name based on the key. @@ -75,6 +82,10 @@ seek' o r = do db <- openDb (uuid r) ea <- exportActions r recordExportBeginning (uuid r) new + + when (exportTracking o) $ + setConfig (remoteConfig r "export-tracking") + (fromRef $ exportTreeish o) -- Clean up after incomplete export of a tree, in which -- the next block of code below may have renamed some files to |