sforceimports does not fetch from the repository specified in the suite
mx sforceimport does not use the location specified in the suites to fetch new revisions but the default remote of the clone. This is for example a problem if one uses a fork as default but the fork does not contain the revision that is requested.
# clone graal-core
git clone --depth 1 https://github.com/graalvm/graal-core
# clone an old version of truffle from an outdated fork
git clone --depth 1 https://github.com/zapster/truffle-outdated truffle
# sforceimport graal-core
cd graal-core
mx -y sforceimports
results in:
fatal: reference is not a tree: f322868c76f775a399bf96915c95e077c4f2c08c
I think we should per default fetch from the repository specified in the suite and add a flag to disable the behavior for scenarios where we never want to use local mirrors.
/cc @gilles-duboscq
I'd say it should check that the repo has a remote which is the same as the one specified in the suite and complain. It could maybe offer to add the remote or tell you how to do it. We also seem to be assuming that after a fetch the changeset we are looking for will be there. Maybe we should rerun the exists query after the fetch to ensure we really got the result we expected.
@zapster, I think it would be best if someone who uses sforceimport takes on this issue.
Well I do think that GitConfig.pull should complain if the pull doesn't produce the rev being requested. hg doesn't have this problem but git simply ignores the rev because you can't really pull a particular rev with git. That's the source of the fatal messages because we later assume the rev is there but it's not.
If you don't use sforceimport what do you use? Manually getting revs from the suite.py?
Yes.
#81 is already a great improvement, thanks @tkrodriguez. I'd still like a flag that uses the specified upstream repo (maybe --upstream?). I will look into it.