| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For a long time the CachedRepo class has basically been a wrapper around
the GitDir class, but with a few extra methods that don't really even
belong there.
It is now a tiny class in the localrepocache module which just keeps
track of a few extra attributes. All other functionality is provided
by the gitdir module.
This commit also removes the `git clone` approach for copying repos out
of the cache. The alternative approach implemented by
git.copy_repository() was slightly faster when I tested, so for now we
should use that everywhere. Longer term we should find out why this is
quicker than `git clone`, and fix Git itself to be fast.
Change-Id: I1686ab43253d44c3903d9a0bad8bb75528e9cf75
|
|
|
|
|
|
|
| |
This commit undoes behaviour changes from commit
aa6dfcbb70c03dfeb3f9af02.
Change-Id: Ie677fb9c4e6bcd6edeba2cdd87f4f6125dcae7a4
|
|
|
|
|
|
| |
It's useful to be able to use this.
Change-Id: Ib32d27ddb637f1b8ed683bdd8ec1db108529a163
|
|
|
|
|
|
|
|
|
|
|
| |
Its going to be more likely that a baserock user is more interesed
in the build log than actually the debug output from morph.
And also the intuitive option would be to use -v for this.
--verbose/-v: show build output
--debug/-d: show morph debug output
Change-Id: I1fb99034dc8680a5f168f6306724663aea33ebc5
|
|
|
|
| |
Change-Id: I992dc0c1d40f563ade56a833162d409b02be90a0
|
|
|
|
|
|
| |
This is nice because it's fast. We don't have to copy all the Git
history along with it like we do with a clone. And it doesn't touch
any files in the cached repo.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This consolidates a bunch of code paths that were previously duplicated.
This also changes the API for local cached repos to match the
function names GitDirectory uses. Note that the remote repo cache still
uses the old names, and should be fixed when time permits.
Some unit tests that use the CachedRepo module required a bit of
inelegant monkey-patching in order that they continue to work. A better
way to do this would be with the 'mock' library (which would need to be
added to Baserock 'build' and 'devel' systems before we could use it).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I was getting the following error when running the 'do-release.py'
script:
ERROR:root:Command failed: morph --quiet --trove-host=git.baserock.org list-artifacts baserock:baserock/definitions sam/auto-release minimal-system-x86_32-generic
ERROR: Ref d67a0e110187abd560a1de63fa172894a52839d5 is an invalid reference for repo git://git.baserock.org/delta/linux
The commit that it wants did actually exist in git.baserock.org and the
logs show that Morph hadn't done a `git remote update` to get the commit
locally.
This turned out to be because it'd had already looked up a different ref
in linux.git. It hadn't needed to run 'git remote update', but it *had*
added linux.git to a "don't need to update this repo again" list. Oops!
I've moved the code in question to the cachedrepo module so that the repo
object keeps that of whether it should be updated. The bug is now fixed.
As a side effect this patch fixes the spurious 'Updating repo
file:///...' messages, which were printed even though repos with
file:/// URLs are never updated.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
CachedRepo.resolve_ref does, effectively, this:
absref = git rev-parse --verify $ref
git log -1 --format=format:%T $absref
Roughly, "git rev-parse" takes any ref and returns the corresponding
SHA1. If the ref looks like a SHA1 (40 hex digits), it is returned
as-is, and despite --verify is not checked for existence.
"git log" then takes the SHA1 and returns the **tree** SHA1, as
opposed to the commit one, and if the commit doesn't exist, barfs.
The unit test for resolve_ref with an invalid SHA1 currently succeeds
for the wrong reason. The mocked _rev_parse fails for an unknown SHA1
(raising cliapp.AppException), which causes resolve_ref to raise
InvalidReferenceError, which the unit test expects. However, the real
implementation of _rev_parse wouldn't fail in that way, and so the
unit test doesn't test the thing it's meant to test: that resolve_ref
actually works the expected way for an unknown SHA1. What actually
happens is that resolve_ref calls _show_tree_hash, which raises
cliapp.AppException for an unknown SHA1, resulting in horror and
despair, instead of resolve_ref raising InvalidReferenceError.
This commit fixes the unit test so that it causes the right code
path in resolve_ref to be executed. This makes the unit test suite
to fail.
|
|\
| |
| |
| |
| |
| | |
Updated copyright years so ./check passes.
Reviewed-by: Richard Maw
|
|/
|
|
|
|
|
|
|
| |
It is almost never a good idea to catch all exceptions, and then do
nothing about them. This patch logs all caught exceptions so that the
user has some possibilty to debug what is happening.
Also, make ./check check for bare excepts and fail the test suite if it
finds anything.
|
|
|
|
|
| |
This was done to ensure tests.branching/branch-fails-if-branch-exists
always passes, but also seems like the right approach in general.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously some code used `git show-ref`, which is wrong -- given two
refs named 'alpha/master' and 'master', `git show-ref master` will
return both, sorted alphabetically. This can lead to build failures,
etc. due to refs resolving to the wrong SHAs.
We should also use `git rev-parse --verify` to verify SHA1s, which
we previously did with `git rev-list`.
Finally, `git rev-parse --verify` is more than twice as fast as
`git show-ref`.
|
|
|
|
|
| |
Currently the message is still displayed "Updating xxx" but no
update is actually done.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The origin/ refs in the system branch checkout repos may or may not be
up to date, and may or may not have been tampered with by the user.
Much better to use our central cache for everything other than changes
to the system branch ref itself, where we should indeed be honouring
the user's local changes.
At a later date we could warn if the user modifies refs other than
the system branch ref but does not push, as these changes will have no
effect.
NOTE: this commit breaks 'morph merge'. It is fixed in the next commit.
|
|
|
|
| |
Update the unit tests so that they pass with the new bare repository caches.
|
| |
|
|
|
|
| |
Adjust all other parts and the tests to work with this.
|
| |
|
|
|
|
|
|
|
|
|
| |
This was done with the aid of the pep8 script, available by running
`easy_install pep8`.
It may be worth making this part of ./check, but that will require
putting pep8 into the development tools stratum.
This should be easy, given pep8 has no external dependencies.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
This requires changing CachedRepo.checkout to handle non-sha1 refs,
which resulted in some further changes in tests and their expected
outputs.
Also, a fix to CachedRepo to use the cwd keyword argument instead
of pwd.
|
| |
|
|
|
|
|
|
| |
This is done to avoid a nasty mix of SourcePool lookups using CachedRepo
objects (e.g. for strata within a system) versus lookups using repo names
(e.g for sources within a stratum).
|
| |
|
|
|