| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Also, move the repo.update() call into the 'fetch from tarball' code
path in the localrepocache module -- there's no need to update straight
after doing a `git clone`, but we do need to do one if we got the repo
from a `git archive` tarball that may be out of date.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
This fixes an issue where various branch-and-merge commands appeared to
be updating Git repos even when --no-git-update was specified. The flag
was actually honoured but the message made it seem as if it was being
ignored.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
| |
This is a helper to avoid having the same code in other places. Have
it in the one place it belongs.
|
|
|
|
|
| |
Currently the message is still displayed "Updating xxx" but no
update is actually done.
|
|
|
|
|
|
|
| |
This makes a non-backward-compatible change to morph which switches it to using
tarballs instead of bundles when initialising cached git repositories. This is
faster because it doesn't require index-pack --fix-thin operations on the
machine running morph.
|
|
|
|
|
|
| |
Log (at chatty) when we start and finish bundle downloads. If we fail for any
reason, log that reason since otherwise it gets swallowed if the plain git
clone succeeds.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
| |
Also, add debugging messages for debugging prefix expansion.
|
|
|
|
| |
The tests, they still fail.
|
|
|
|
|
|
|
|
| |
Changed the delimieter between push and pull patterns to be #,
since = is reasonably frequent in URLs, and # should never be
necessary in git urls.
Oh my how many tests now fail.
|
| |
|
| |
|
|
|
|
|
| |
This way, cliapp will automatically print an error message, rather
than a stack trace.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
It needed shutil, but that exception was being missed.
_git needs to be able to handle a different current directory for
remote set-url to work
|
|
|
|
|
|
| |
When cloning from a bundle it makes the origin remote url point to the
bundle. This is not ideal as we want to update these repositories later
from upstream.
|
|
|
|
| |
They must end with .bndl as that is the format lorry generates
|
|
|
|
|
|
|
|
| |
Also change _fetch to throw its exception as since it is more pythonic
to throw exceptions than return exit status, other error handling needed
to be caught, so it hsa been kept consistent.
This required the tests to throw an exception as well
|
|
|
|
|
| |
It should check that it doesn't already have the repository cached
under a different base-url before cloning, likewise with bundles.
|
| |
|
|
|
|
|
|
|
|
| |
The self._exists method needs to be used instead of raw os.path.exists,
so that unit tests can override it easily.
Also, a tiny clarification so that the caller of _clone_with_bundle
decides whether it's OK to try to download a bundle.
|
| |
|
| |
|
| |
|
| |
|
|
Jannis and I discussed a refactoring of most of morph's internals
to reduce coupling and increase cohesion. This is one of the results:
we'll want a couple of classes to manage locally cached git repositories.
This commit adds the LocalRepoCache class to manage a the git cache
directory. Later on, we'll add the CachedRepo class to represent
individual repositories.
|