Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync repo darcs #7137

Merged
merged 6 commits into from
Aug 26, 2021
Merged

Sync repo darcs #7137

merged 6 commits into from
Aug 26, 2021

Conversation

strake
Copy link
Contributor

@strake strake commented Oct 29, 2020

It was falsely advertized to be supported. Now it should work.

I know not how to reset to a given repo state with Darcs, so if the local copy is not in the wanted state, cabal blows it away and re-clones it. It's not ideal but it does the job.

Tested for a while in some personal projects of mine.

  • Patches conform to the coding conventions.
  • Any changes that could be relevant to users have been recorded in the changelog (add file to changelog.d directory).
  • The documentation has been updated, if necessary.

@strake
Copy link
Contributor Author

strake commented Oct 29, 2020

I'm not sure how the changelog works — should i make a file "changelog.d/sync-repo" or what?

@strake
Copy link
Contributor Author

strake commented Jan 18, 2021

ping

@fgaz
Copy link
Member

fgaz commented Jan 20, 2021

I'm not sure how the changelog works — should i make a file "changelog.d/sync-repo" or what?

Yes, you can look at the other files for an example

Copy link
Member

@fgaz fgaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly style/clarity stuff :)

@@ -305,7 +314,43 @@ vcsDarcs =

vcsSyncRepos :: Verbosity -> ConfiguredProgram
-> [(SourceRepositoryPackage f, FilePath)] -> IO [MonitorFilePath]
vcsSyncRepos _v _p _rs = fail "sync repo not yet supported for darcs"
vcsSyncRepos verbosity prog = \ case
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LambdaCase is almost absent from the cabal codebase, I think we can avoid it here too and just match directly on rs instead, since it's just two cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

cabal-install/src/Distribution/Client/VCS.hs Outdated Show resolved Hide resolved
| Just tag <- (List.stripPrefix "tagged " . List.dropWhile Char.isSpace) x
, Just tag' <- srpTag
, tag == tag' -> pure ()
Left (_ :: SomeException) -> pure ()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should we ignore the exception? The one that needed catching was already taken care of below, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh... this part is subtle and my code was indeed wrong. PTAL to see whether it makes more sense now.

cabal-install/src/Distribution/Client/VCS.hs Outdated Show resolved Hide resolved
cabal-install/src/Distribution/Client/VCS.hs Outdated Show resolved Hide resolved
cabal-install/src/Distribution/Client/VCS.hs Outdated Show resolved Hide resolved
cabal-install/src/Distribution/Client/VCS.hs Outdated Show resolved Hide resolved
@strake strake force-pushed the sync-repo-darcs branch from 7939940 to 02e0dcb Compare May 9, 2021 18:03
@strake strake force-pushed the sync-repo-darcs branch from 02e0dcb to 91f3212 Compare May 9, 2021 18:07
@strake strake requested a review from fgaz May 9, 2021 18:11
@emilypi
Copy link
Member

emilypi commented Aug 13, 2021

@Mergifyio update

@mergify
Copy link
Contributor

mergify bot commented Aug 13, 2021

Command update: success

Branch has been successfully updated

@emilypi emilypi added the merge me Tell Mergify Bot to merge label Aug 26, 2021
@emilypi emilypi merged commit 8f5b2f0 into haskell:master Aug 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
attention: needs-review merge me Tell Mergify Bot to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants