Skip to content

Commit 5a8d37e

Browse files
committed
Cabal 3.4: KnownRepoType (reorganized data type) (#1016)
1 parent cf6cf91 commit 5a8d37e

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

src/Distribution/Server/Pages/Package.hs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ sourceRepositoryToHtml :: SourceRepo -> Html
526526
sourceRepositoryToHtml sr
527527
= toHtml (display (repoKind sr) ++ ": ")
528528
+++ case repoType sr of
529-
Just Darcs
529+
Just (KnownRepoType Darcs)
530530
| (Just url, Nothing, Nothing) <-
531531
(repoLocation sr, repoModule sr, repoBranch sr) ->
532532
concatHtml [toHtml "darcs clone ",
@@ -540,7 +540,7 @@ sourceRepositoryToHtml sr
540540
<< toHtml sd)
541541
+++ toHtml ")"
542542
Nothing -> noHtml]
543-
Just Git
543+
Just (KnownRepoType Git)
544544
| (Just url, Nothing) <-
545545
(repoLocation sr, repoModule sr) ->
546546
concatHtml [toHtml "git clone ",
@@ -554,15 +554,15 @@ sourceRepositoryToHtml sr
554554
case repoSubdir sr of
555555
Just sd -> toHtml ("(" ++ sd ++ ")")
556556
Nothing -> noHtml]
557-
Just SVN
557+
Just (KnownRepoType SVN)
558558
| (Just url, Nothing, Nothing, Nothing) <-
559559
(repoLocation sr, repoModule sr, repoBranch sr, repoTag sr) ->
560560
concatHtml [toHtml "svn checkout ",
561561
anchor ! [href url] << toHtml url,
562562
case repoSubdir sr of
563563
Just sd -> toHtml ("(" ++ sd ++ ")")
564564
Nothing -> noHtml]
565-
Just CVS
565+
Just (KnownRepoType CVS)
566566
| (Just url, Just m, Nothing, Nothing) <-
567567
(repoLocation sr, repoModule sr, repoBranch sr, repoTag sr) ->
568568
concatHtml [toHtml "cvs -d ",
@@ -571,7 +571,7 @@ sourceRepositoryToHtml sr
571571
case repoSubdir sr of
572572
Just sd -> toHtml ("(" ++ sd ++ ")")
573573
Nothing -> noHtml]
574-
Just Mercurial
574+
Just (KnownRepoType Mercurial)
575575
| (Just url, Nothing) <-
576576
(repoLocation sr, repoModule sr) ->
577577
concatHtml [toHtml "hg clone ",
@@ -585,7 +585,7 @@ sourceRepositoryToHtml sr
585585
case repoSubdir sr of
586586
Just sd -> toHtml ("(" ++ sd ++ ")")
587587
Nothing -> noHtml]
588-
Just Bazaar
588+
Just (KnownRepoType Bazaar)
589589
| (Just url, Nothing, Nothing) <-
590590
(repoLocation sr, repoModule sr, repoBranch sr) ->
591591
concatHtml [toHtml "bzr branch ",

src/Distribution/Server/Pages/PackageFromTemplate.hs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ sourceRepositoryToHtml :: SourceRepo -> Html
378378
sourceRepositoryToHtml sr
379379
= toHtml (display (repoKind sr) ++ ": ")
380380
+++ case repoType sr of
381-
Just Darcs
381+
Just (KnownRepoType Darcs)
382382
| (Just url, Nothing, Nothing) <-
383383
(repoLocation sr, repoModule sr, repoBranch sr) ->
384384
concatHtml [toHtml "darcs get ",
@@ -392,7 +392,7 @@ sourceRepositoryToHtml sr
392392
<< toHtml sd)
393393
+++ toHtml ")"
394394
Nothing -> noHtml]
395-
Just Git
395+
Just (KnownRepoType Git)
396396
| (Just url, Nothing) <-
397397
(repoLocation sr, repoModule sr) ->
398398
concatHtml [toHtml "git clone ",
@@ -406,15 +406,15 @@ sourceRepositoryToHtml sr
406406
case repoSubdir sr of
407407
Just sd -> toHtml ("(" ++ sd ++ ")")
408408
Nothing -> noHtml]
409-
Just SVN
409+
Just (KnownRepoType SVN)
410410
| (Just url, Nothing, Nothing, Nothing) <-
411411
(repoLocation sr, repoModule sr, repoBranch sr, repoTag sr) ->
412412
concatHtml [toHtml "svn checkout ",
413413
anchor ! [href url] << toHtml url,
414414
case repoSubdir sr of
415415
Just sd -> toHtml ("(" ++ sd ++ ")")
416416
Nothing -> noHtml]
417-
Just CVS
417+
Just (KnownRepoType CVS)
418418
| (Just url, Just m, Nothing, Nothing) <-
419419
(repoLocation sr, repoModule sr, repoBranch sr, repoTag sr) ->
420420
concatHtml [toHtml "cvs -d ",
@@ -423,7 +423,7 @@ sourceRepositoryToHtml sr
423423
case repoSubdir sr of
424424
Just sd -> toHtml ("(" ++ sd ++ ")")
425425
Nothing -> noHtml]
426-
Just Mercurial
426+
Just (KnownRepoType Mercurial)
427427
| (Just url, Nothing) <-
428428
(repoLocation sr, repoModule sr) ->
429429
concatHtml [toHtml "hg clone ",
@@ -437,7 +437,7 @@ sourceRepositoryToHtml sr
437437
case repoSubdir sr of
438438
Just sd -> toHtml ("(" ++ sd ++ ")")
439439
Nothing -> noHtml]
440-
Just Bazaar
440+
Just (KnownRepoType Bazaar)
441441
| (Just url, Nothing, Nothing) <-
442442
(repoLocation sr, repoModule sr, repoBranch sr) ->
443443
concatHtml [toHtml "bzr branch ",
@@ -456,7 +456,7 @@ sourceRepositoryToHtml sr
456456
toHtml " ",
457457
toHtml (takeFileName (dropTrailingPathSeparator url) ++ ".fossil")
458458
]
459-
Just (OtherRepoType "pijul")
459+
Just (KnownRepoType Pijul)
460460
| (Just url, Nothing, Nothing) <-
461461
(repoLocation sr, repoModule sr, repoTag sr) ->
462462
concatHtml [toHtml "pijul clone ",

0 commit comments

Comments
 (0)