| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
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: I63f0d9da8b12930bd9539710429756a0821ce884
|
|
|
|
| |
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).
|
|
|
|
|
|
|
|
|
|
|
|
| |
Morph can appear to hang in situations where it is actually waiting on a
slow network operation. This change gives users a way to see the output
of the subcommands that are doing the network IO (either 'wget', 'git
clone' or 'git remote update').
The status information goes onto stderr, because that is where the
subcommands write it. Morph tends to put its status output on stdout,
but (a) some commands are machine-parsed, such as `serialise-artifact`
and (b) it's tricky to get Git to put status output on stdout.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We assumed that the sha1 of the tree of the commit of the ref we care
about was sufficient to cache, but `git replace` means that you need to
know the state of other branches too, since anything in refs/replace can
completely change what the tree you check-out is.
This behaviour can be disabled globally by setting
GIT_NO_REPLACE_OBJECTS, so we're going to do that.
If we need to integrate a project that uses git-replace to change the
contents of their git trees then we could support that by:
if any(refs/replace/*):
potentially_replacable_objects = [
`git rev-parse HEAD`,
`git rev-parse HEAD^{commit}`,
`git rev-parse HEAD^{tree}`]
potentially_replacable_objects.extend(
`git ls-tree -r HEAD | awk '{print $3}'`)
# NOTE: doesn't handle submodules, and you'd need to expand this
# set whenever you process a replacement
for object in refs/replace/*:
if basename(object) not in potentially_replacable_objects: continue
cache_key['replacements'][basename(object)] = `git rev-parse $object`
If we were to support this would need to traverse the tree anyway, doing
replacements, so we may as well use libgit to do the checkout anyway,
and list which replacements were used.
However, since the expected use-case of `git replace` is as a better way
to do history grafting, we're unlikely to need it, as it would only have
any effect if it replaced the commit we were using with a different one.
Rubber-stamped-by: Daniel Silverstone
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
This changes how CachedRepo runs git to get the SHA1 information
it needs, based on a suggestion by Richard Maw.
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Scenario: a repository contains a ref: refs/heads/foo and we
have that in our repository cache.
Action: upstream deletes that ref and then pushes a new refs
at refs/heads/foo/bar.
Action: we attempt to update the git and the update fails because
git remote update cannot cope with the 'kind' change of
refs/heads/foo from ref to directory.
Remedy: If we get an exception from the remote update --prune we
try the less efficient but more resilient combination of
first pruning and then updating.
Reviewed-By: Lars Wirzenius (over the shoulder)
Reviewed-By: Richard Maw (over the shoulder)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
This reworks the code for managing and using the git caches in morph to treat
the caches as bare repositories which are mirrors of where we clone from. In
addition we correctly prune the branches during updates, so that we don't end
up accumulating pointless branches over and over. This is even more important
with branch-and-merge generating temporary build refs for things.
|
| |
|
|
|
|
| |
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).
|
| |
|
| |
|
| |
|
| |
|
|
|