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

Fix repo handling #970

Merged
merged 1 commit into from
Jan 8, 2019
Merged

Fix repo handling #970

merged 1 commit into from
Jan 8, 2019

Conversation

00vareladavid
Copy link
Contributor

@00vareladavid 00vareladavid commented Dec 20, 2018

I started off just trying to break down handle_repos_add (it was a beast!) but the refactoring allowed two bugs to be fixed along the way.

Fixes #951. In the first stage (resolve_repo_add!) we make sure certain fields of the PackageSpec are filled out (name, uuid, repo.url, repo.rev). This means we can have more consistent logic for the rest of the operation. In particular, once we have the UUID, it is simple to check if the package is pinned.

Fixes #614. I added a test which simply makes sure that the mtime for the source is the same after an add by URL.

In terms of refactoring, moving all git-heavy operations into their own functions helps to clarify the add-specific logic. Also, handle_repos_add! was being called from many places. It turns out those calls just needed some more limited functionality which is now in instantiate_pkg_repo!.

@00vareladavid
Copy link
Contributor Author

bors try

bors bot added a commit that referenced this pull request Dec 20, 2018
@bors
Copy link
Contributor

bors bot commented Dec 21, 2018

@KristofferC
Copy link
Member

bors r+

bors bot added a commit that referenced this pull request Jan 8, 2019
970: Fix repo handling r=KristofferC a=00vareladavid

I started off just trying to break down `handle_repos_add` (it was a beast!) but the refactoring allowed two bugs to be fixed along the way.

Fixes #951. In the first stage (`resolve_repo_add!`) we make sure certain fields of the `PackageSpec` are filled out (`name`, `uuid`, `repo.url`, `repo.rev`). This means we can have more consistent logic for the rest of the operation. In particular, once we have the UUID, it is simple to check if the package is pinned.

Fixes #614. I added a test which simply makes sure that the `mtime` for the source is the same after an `add` by URL.

In terms of refactoring, moving all git-heavy operations into their own functions helps to clarify the `add`-specific logic. Also, `handle_repos_add!` was being called from many places. It turns out those calls just needed some more limited functionality which is now in `instantiate_pkg_repo!`.

Co-authored-by: David Varela <00.varela.david@gmail.com>
@bors
Copy link
Contributor

bors bot commented Jan 8, 2019

@bors bors bot merged commit 806ed29 into JuliaLang:master Jan 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pkg.add with explicit URL ignores pin Pkg add with url overwrites existing files
2 participants