Skip to content
This repository was archived by the owner on Dec 11, 2019. It is now read-only.

"Added error checking for non hg repo" (moving felipec:#44) #19

Closed
wants to merge 1 commit into from

Conversation

alexei-31
Copy link

This request is transferred from the old project, and may be more relevant here.
See the discussion in the old issue felipec:#44

@alexei-31
Copy link
Author

I can combine this request (#19) with #18 in the one "pull request" (as is done in #16) for your comfort and beautiful history, if both of them are approved.

@fingolfin
Copy link
Owner

This seems like a nice idea, but the implementation is a bit lacking. E.g. the new error message Is it already git? is not very clear and IMHO does not help the confused as much as it could. Perhaps Is this really a hg repository? ? Also, there can be other RepoErrors, and then this message is probably confusing, too. So the check for the error condition could be tightened, to verify it is the "right" kind of error.
A completely different approach would be for us to check whether there is a .hg subdirectory, and if not, generate an error message of our own. Advantage: We do not have to add a hack to distinguish between different RepoErrors. Disadvantage: There is a tiny chance of a race condition (we check for a .hg repository, and find it; then pass control to Mercurial, but in the meantime, the .hg repository is removed), but if that happens, the user is in trouble anyway. Another hypothetical disadvantage: Perhaps in the future there can be hg repos clones without a .hg subdirectory?

Another minor issue with this change: It also breaks the code formatting (wrong indention).

@rusimody Any chance you might want to work on that? If not, I'd just re-implement this from scratch along the lines I described above.

@alexei-31
Copy link
Author

It is the best solution of the existing ones. I had to work hard as they removed their own repository, there was only a pull request in the old fork (author branch was deleted).

Again, you can accept a commit, and then make it ideal others commit, when you have time.

Of course, you can postpone this work, but it will be more comfortable lives, even if leave it in this form.

@alexei-31
Copy link
Author

I'm not very good with python, so ready to accept changes in its branch.

I invite everyone to send them to me.Help bring the code to all the wishes that @fingolfin asks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants