Open
Conversation
Otherwise it won't work on Windows currently.
Sija
reviewed
Jan 4, 2021
Contributor
Sija
left a comment
There was a problem hiding this comment.
Couple of idiomatic suggestions.
src/resolvers/hg.cr
Outdated
|
|
||
| protected def versions_from_tags | ||
| capture_hg("tags", "--template", "{tag}\\n") | ||
| .split('\n') |
Contributor
There was a problem hiding this comment.
Suggested change
| .split('\n') | |
| .lines |
src/resolvers/hg.cr
Outdated
| return HgTagRef.new value | ||
| when "commit" | ||
| return HgCommitRef.new value | ||
| else |
src/resolvers/hg.cr
Outdated
| source = hg_url | ||
| # Remove a "file://" from the beginning, otherwise the path might be invalid | ||
| # on Windows. | ||
| source = source[7..] if source.starts_with?("file://") |
Contributor
There was a problem hiding this comment.
Suggested change
| source = source[7..] if source.starts_with?("file://") | |
| source = source.lchop("file://") |
src/resolvers/hg.cr
Outdated
Comment on lines
+353
to
+354
| yield | ||
| break |
Contributor
There was a problem hiding this comment.
Suggested change
| yield | |
| break | |
| return yield |
src/resolvers/hg.cr
Outdated
|
|
||
| private def valid_repository? | ||
| File.each_line(File.join(local_path, ".hg", "dirstate")) do |line| | ||
| return true if line =~ /mirror\s*=\s*true/ |
Contributor
There was a problem hiding this comment.
Suggested change
| return true if line =~ /mirror\s*=\s*true/ | |
| return true if line.matches?(/mirror\s*=\s*true/) |
Member
|
Please let's focus on #458 first and revisit this once that is merged. |
…exist Exceptions should only be used on real errors, not on expected fails.
Member
|
#458 has been merged, so we can move forward with this. Sorry for the slow review process 🙇♂️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a modification of the HgResolver from some other pull request to make use of the hg command server to speed up hg commands.
The mercurial command server is feature of hg to overcome the (relatively long) startup time of the Python interpreter. Instead of starting a new interpreter for each single hg command only a single process is started. All subsequent hg commands are then passed to this running process.
The command server is started by
HgResolverthe first time a command is run. The same command server is also used for all test cases.This overall reduces the running time of all hg tests to a few seconds.