darcs-fastconvert 0.2 → 0.2.1
raw patch · 3 files changed
+15/−17 lines, 3 filesdep −darcs-betadep ~cmdlib
Dependencies removed: darcs-beta
Dependency ranges changed: cmdlib
Files
- Export.hs +6/−2
- darcs-fastconvert.cabal +3/−9
- main.hs +6/−6
Export.hs view
@@ -50,10 +50,14 @@ patchName = piName . info patchDate = formatDateTime "%s +0000" . fromClockTime . toClockTime . piDate . info -patchAuthor p = case span (/='<') $ piAuthor (info p) of- (n, "") -> n ++ " <unknown>"+patchAuthor p = case span (/='<') author of+ (n, "") -> case span (/='@') $ author of+ -- john@home -> john <john@home>+ (n, "") -> n ++ " <unknown>"+ (name, _) -> name ++ " <" ++ author ++ ">" (n, rest) -> case span (/='>') $ tail rest of (email, _) -> n ++ "<" ++ email ++ ">"+ where author = piAuthor (info p) patchMessage p = BL.concat [ BLU.fromString (piName $ info p) , case (unlines . piLog $ info p) of
darcs-fastconvert.cabal view
@@ -7,7 +7,7 @@ -- The package version. See the Haskell package versioning policy -- (http://www.haskell.org/haskellwiki/Package_versioning_policy) for -- standards guiding when and how versions should be incremented.-Version: 0.2+Version: 0.2.1 -- A short (one-line) description of the package. Synopsis: Import/export git fast-import streams to/from darcs.@@ -57,22 +57,16 @@ type: darcs location: http://repos.mornfall.net/darcs-fastconvert -flag beta- description: use darcs-beta instead of darcs- Executable darcs-fastconvert -- .hs or .lhs file containing the Main module. Main-is: main.hs ghc-options: -Wall -fno-warn-unused-do-bind - if flag(beta)- build-depends: darcs-beta >= 2.4.98.5 && < 2.5- else- build-depends: darcs >= 2.5 && < 2.6+ build-depends: darcs >= 2.5 && < 2.6 -- Packages needed in order to build this package. Build-depends: hashed-storage >= 0.5.3 && < 0.6,- cmdlib >= 0.2 && < 0.3,+ cmdlib >= 0.3 && < 0.4, base >= 4 && < 5, attoparsec >= 0.8 && < 0.9, datetime, old-time, filepath, bytestring, mtl,
main.hs view
@@ -17,11 +17,11 @@ instance Attributes Cmd where attributes _ = repo %> [ Positional 0 ] %% group "Options"- [ format %> [ Help "repository type to create: darcs-2 (default) or hashed"- , Default Darcs2Format ]- , create %> [ Help "create a new repository", Default True ]- , readMarks %> [ Help "continue conversion, previously checkpointed by --write-marks"- , ArgHelp "FILE" ]+ [ format %> [ Help "repository type to create: darcs-2 (default) or hashed"+ , Default Darcs2Format ]+ , create %> [ Help "create a new repository", Default True ]+ , readMarks %> [ Help "continue conversion, previously checkpointed by --write-marks"+ , ArgHelp "FILE" ] , writeMarks %> [ Help "checkpoint conversion to continue it later" , ArgHelp "FILE" ] ] @@ -43,7 +43,7 @@ [] -> return () x -> Marks.writeMarks x marks' -main = getArgs >>= dispatchR [] undefined >>= \x -> case x of+main = getArgs >>= dispatchR [] >>= \x -> case x of Import {} | create x && null (readMarks x) -> case readMarks x of [] -> (format x) `seq` -- avoid late failure handleMarks x (const $ fastImport (repo x) (format x))