fix reversion in unexport when unable to rename
Bug introduced in commit 7cef5e8f35
This commit is contained in:
parent
f001ae7c09
commit
9bf4f2eb16
1 changed files with 6 additions and 2 deletions
|
@ -409,13 +409,15 @@ startMoveToTempName :: Remote -> ExportHandle -> TopFilePath -> Key -> CommandSt
|
||||||
startMoveToTempName r db f ek = case renameExport (exportActions r) of
|
startMoveToTempName r db f ek = case renameExport (exportActions r) of
|
||||||
Just _ -> starting ("rename " ++ name r) ai si $
|
Just _ -> starting ("rename " ++ name r) ai si $
|
||||||
performRename r db ek loc tmploc
|
performRename r db ek loc tmploc
|
||||||
Nothing -> stop
|
Nothing -> starting ("unexport " ++ name r) ai' si $
|
||||||
|
performUnexport r db [ek] loc
|
||||||
where
|
where
|
||||||
loc = mkExportLocation f'
|
loc = mkExportLocation f'
|
||||||
f' = getTopFilePath f
|
f' = getTopFilePath f
|
||||||
tmploc = exportTempName ek
|
tmploc = exportTempName ek
|
||||||
ai = ActionItemOther $ Just $
|
ai = ActionItemOther $ Just $
|
||||||
QuotedPath f' <> " -> " <> QuotedPath (fromExportLocation tmploc)
|
QuotedPath f' <> " -> " <> QuotedPath (fromExportLocation tmploc)
|
||||||
|
ai' = ActionItemTreeFile (fromExportLocation loc)
|
||||||
si = SeekInput []
|
si = SeekInput []
|
||||||
|
|
||||||
startMoveFromTempName :: Remote -> ExportHandle -> Key -> TopFilePath -> CommandStart
|
startMoveFromTempName :: Remote -> ExportHandle -> Key -> TopFilePath -> CommandStart
|
||||||
|
@ -423,13 +425,15 @@ startMoveFromTempName r db ek f = case renameExport (exportActions r) of
|
||||||
Just _ -> stopUnless (liftIO $ elem tmploc <$> getExportedLocation db ek) $
|
Just _ -> stopUnless (liftIO $ elem tmploc <$> getExportedLocation db ek) $
|
||||||
starting ("rename " ++ name r) ai si $
|
starting ("rename " ++ name r) ai si $
|
||||||
performRename r db ek tmploc loc
|
performRename r db ek tmploc loc
|
||||||
Nothing -> stop
|
Nothing -> starting ("unexport " ++ name r) ai' si $
|
||||||
|
performUnexport r db [ek] tmploc
|
||||||
where
|
where
|
||||||
loc = mkExportLocation f'
|
loc = mkExportLocation f'
|
||||||
f' = getTopFilePath f
|
f' = getTopFilePath f
|
||||||
tmploc = exportTempName ek
|
tmploc = exportTempName ek
|
||||||
ai = ActionItemOther $ Just $
|
ai = ActionItemOther $ Just $
|
||||||
QuotedPath (fromExportLocation tmploc) <> " -> " <> QuotedPath f'
|
QuotedPath (fromExportLocation tmploc) <> " -> " <> QuotedPath f'
|
||||||
|
ai' = ActionItemTreeFile (fromExportLocation tmploc)
|
||||||
si = SeekInput []
|
si = SeekInput []
|
||||||
|
|
||||||
performRename :: Remote -> ExportHandle -> Key -> ExportLocation -> ExportLocation -> CommandPerform
|
performRename :: Remote -> ExportHandle -> Key -> ExportLocation -> ExportLocation -> CommandPerform
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue