-
-
Notifications
You must be signed in to change notification settings - Fork 216
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
Support working on a Git repository with hg-git #532
Conversation
thanks for attempting this, i think it would be a improvement for the hg one not to get confused between tags and bookmarks in general, so it may be a better variant to jsut add a test for hg to make it stop confusing branches and tags |
Yes, I see that I can actually simplify and clean up quite a bit the code... |
for more information, see https://pre-commit.ci
I did a quite big refactoring. I still need to add some tests for hg-git but I guess a first review could be useful. Also, I hope there are no PR more advanced that this one that modify a lot hg.py and git.py, because rebasing/merging could be a pain. |
Regarding the confusion between tags and bookmarks in general, I think it is mainly related to people using hg-git. hg-git adds some tags corresponding to remote Git branches (which explain this message #235 (comment)). In standard Mercurial, we don't have that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just took a quick skim on mobile and I like what i see
I'll give it a deeper dig in the evening
Don't worry about the prs, the only one related has to be redone to begin with
|
||
class Workdir: | ||
def __init__(self, path): | ||
require_command(self.COMMAND) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that the command is used only at a few specified places,
If the requirement is checked in the named constructors, it may not be necessary to explicitly handle certain details
I'm not super familiar with pytest fixtures. For the tests, I need to create first a Git repo (as in the |
@paugier the creation of such a fixture certainly is a bit of a pita, its something thats a bit boggling for myself as well i'll take a night of sleep and hopefully have a reasonable suggestion tommorow |
i still didn't come up with a good way, it may be ok to just make a small repo that exposes the issues and putting it into a tarball to extract in a test until the api is actually better |
I found a solution which works at home. Now hg-git needs to be installed for the CI. But actually, I didn't find how |
mercurial was just installed with the base image, |
It should be sufficient to run something like (here for Linux)
I don't know the equivalent for Windows but this shouldn't be difficult. Then, we need to put in a .hgrc
but this can be done in the test. |
that would break in a number of setups, lets add a extra step/requirement to prevent bad failure |
based on https://foss.heptapod.net/mercurial/hg-git im under the impression its ok to do the pip install command on the ci setup setup a end-user facing solution is still necessary |
I don't understand why the CI runs were not triggered after my last push...
This code will be used only for end users working with a Mercurial repository containing a directory .hg/git with the default path pointing towards a Git repository. Should I also add a condition to use it only if hg-git is importable by the python used by Mercurial? For setuptools_scm developers, the test will be skip if hggit is not installed. |
please add the condition, also sorry for the delays, im currently pretty stretched with personal time |
Hum, sorry but I don't get it. Which condition? |
from your question earlier
|
I added the condition (see https://github.com/pypa/setuptools_scm/pull/532/files#diff-74f525775c1b35086b22582997e4b7397cefd5f484d373c039e3b3a0cd39fa92R4) and merged main into this branch. Locally, all tests pass. |
I see that there are "2 workflows awaiting approval". Can this be tried ? Moreover, this PR might finally be ready to be merged :-) |
wow, hg-git is a hell to install on the linux actions :/ |
thanks for your patience and preservance |
Oh finally, it's all green! And as expected the hg-git test passes on Ubuntu and is skipped on Windows! |
do you want to rebase/squash anything or can i merge ? :) |
I'm fine with putting all that mess in the main branch! I was told that small commits are good :-) Thanks for you patience on this PR! |
Thanks for sticking trough this long winded process :) |
Mercurial can be used as a Git client with hg-git. Then, one would like to get the same version as with Git (in particular, with Git sha). I tried to implement that in this PR. It's an early draft without tests!
This PR fixes #530.