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

import: Fix KeyError in shallow clones #403

Merged
merged 1 commit into from Apr 8, 2021

Conversation

craigds
Copy link
Member

@craigds craigds commented Apr 8, 2021

Description

In dc2153d I made imports adjust
feature comparison behaviour based on whether the repo has
previously had a schema change or not.

However, this involves walking the repo log, and in shallow clones
some commits may be unavailable, causing a KeyError.

This commit fixes the KeyError and always does the feature comparison
if in a shallow clone where the last schema change commit is not
available.

Related links:

.

Checklist:

  • Have you reviewed your own change?
  • Have you included test(s)?
  • Have you updated the changelog?

@craigds craigds requested a review from olsen232 April 8, 2021 21:47
class CommitMissing(Exception):
pass

def iter_log(repo):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Name is a bit vague - maybe safe_walk_repo or something

In dc2153d I made imports adjust
feature comparison behaviour based on whether the repo has
previously had a schema change or not.

However, this involves walking the repo log, and in shallow clones
some commits may be unavailable, causing a KeyError.

This commit fixes the KeyError and always does the feature comparison
if in a shallow clone where the last schema change commit is not
available.
@craigds craigds force-pushed the fix-import-in-shallow-clone branch from 86715eb to 3e1e306 Compare April 8, 2021 21:58
@craigds craigds merged commit 9aa6c70 into master Apr 8, 2021
@craigds craigds deleted the fix-import-in-shallow-clone branch April 8, 2021 21:59
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.

None yet

2 participants