From 7d237b75406dd3a03b0db6b1621bde564cbf4709 Mon Sep 17 00:00:00 2001 From: fr33domlover Date: Thu, 24 May 2018 21:45:01 +0000 Subject: [PATCH] Adapt to darcs-lights and changes in darcs-rev --- INSTALL.md | 2 +- clone-deps.sh | 1 + src/Vervis/Darcs.hs | 10 +++++----- stack.yaml | 1 + vervis.cabal | 1 + 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 4d62dca..2e8f1d8 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -71,7 +71,7 @@ always up to date. Basically it works like this: [Darcs Hub page](https://hub.darcs.net/fr33domlover) - Use `darcs clone` to grab the library source code -As of May 23, 2018, you can grab these libraries by simply running the +As of May 24, 2018, you can grab these libraries by simply running the [`clone-deps.sh`](./clone-deps.sh) script. Update `stack.yaml` to specify the paths in the `packages` section if needed: diff --git a/clone-deps.sh b/clone-deps.sh index 29bcf97..6e2c8ac 100644 --- a/clone-deps.sh +++ b/clone-deps.sh @@ -6,6 +6,7 @@ HUB='https://hub.darcs.net/fr33domlover' darcs clone $HUB/hit-graph darcs clone $HUB/hit-harder darcs clone $HUB/hit-network +darcs clone $VERVIS/darcs-lights darcs clone $VERVIS/darcs-rev darcs clone $VERVIS/ssh darcs clone $VERVIS/persistent-migration diff --git a/src/Vervis/Darcs.hs b/src/Vervis/Darcs.hs index 9d11337..0d7b0d9 100644 --- a/src/Vervis/Darcs.hs +++ b/src/Vervis/Darcs.hs @@ -192,10 +192,10 @@ readChangesView path off lim = fmap maybeRight $ runExceptT $ do let off' = total - off - lim ps <- ExceptT $ readLatestInventory path $ latestInventoryPageP off' lim now <- lift getCurrentTime - let toLE pi h = LogEntry + let toLE (pi, h, _) = LogEntry { leAuthor = T.stripEnd $ T.takeWhile (/= '<') $ piAuthor pi - , leHash = decodeStrict $ encodePatchHash h + , leHash = decodeStrict $ encodePatchInfoHash h , leMessage = piTitle pi , leTime = ( piTime pi @@ -204,7 +204,7 @@ readChangesView path off lim = fmap maybeRight $ runExceptT $ do now `diffUTCTime` piTime pi ) } - return (total, map (uncurry toLE) $ reverse $ snd ps) + return (total, map toLE $ reverse $ snd ps) lastChange :: FilePath -> UTCTime -> IO (Maybe EventTime) lastChange path now = fmap maybeRight $ runExceptT $ do @@ -213,8 +213,8 @@ lastChange path now = fmap maybeRight $ runExceptT $ do off = total - lim (_, l) <- ExceptT $ readLatestInventory path $ latestInventoryPageP off lim return $ case reverse l of - [] -> Never - (pi, _ph) : _ -> + [] -> Never + (pi, _ih, _ch) : _ -> intervalToEventTime $ FriendlyConvert $ now `diffUTCTime` piTime pi diff --git a/stack.yaml b/stack.yaml index 01df4be..fec00bd 100644 --- a/stack.yaml +++ b/stack.yaml @@ -8,6 +8,7 @@ resolver: lts-10.10 # Local packages, usually specified by relative directory name packages: - '.' + - '../darcs-lights' - '../darcs-rev' - '../ssh' - '../hit-graph' diff --git a/vervis.cabal b/vervis.cabal index 30d0858..79c69ae 100644 --- a/vervis.cabal +++ b/vervis.cabal @@ -229,6 +229,7 @@ library -- for Storage.Hashed because hashed-storage seems -- unmaintained and darcs has its own copy , darcs + , darcs-lights , darcs-rev , data-default , data-default-class