summaryrefslogtreecommitdiff
path: root/morphlib
Commit message (Collapse)AuthorAgeFilesLines
* morph merge: Use a special git merge driver for morphology filesSam Thursfield2012-09-271-7/+121
| | | | | | | | | | We now have a two-stage merge process. Stage one only runs if there are changes in both branches on the same file. At the end of stage one we assume that all the components that were edited in the FROM branch still have their 'ref' field set to the FROM branch. Morph then iterates through these repositories, performing a merge in each one, and then updates the refs in the morphologies again with the correct target branches.
* morph merge: Set status on successSam Thursfield2012-09-271-0/+2
| | | | | We print a bunch of stuff if conflicts are encountered, so we should make it clear at the end whether ultimately they were all resolvable or not.
* morph merge: Error message wranglingSam Thursfield2012-09-271-5/+6
| | | | | These do need to be quite clear, because merge failures will happen a lot and we are relatively unhelpful at the moment.
* Rename arm to armv7 and be consistentRichard Maw2012-09-274-6/+6
| | | | | armv5 and armv7 are different enough to be a problem, so specify which particular arm sub-architecture we currently support.
* morph merge: Clean up on failureSam Thursfield2012-09-251-50/+72
| | | | | | Run git reset --hard in all repos if we get an exception at any point. merge_system() is extracted out of merge() to avoid comedy indentation.
* morph merge: Handle merge conflicts more helpfullySam Thursfield2012-09-251-9/+35
| | | | | Unless the error is in the system morphs repo, we carry on trying to merge after errors and report all of the failures at the end.
* morph merge: Consolidate more functionality in merge_repo()Sam Thursfield2012-09-251-29/+33
|
* morph merge: Always pull --no-commit, so we can roll back more easilySam Thursfield2012-09-251-11/+12
|
* morph merge: Better errors from checkout_repository()Sam Thursfield2012-09-251-2/+8
|
* Merge remote-tracking branch ↵Daniel Silverstone2012-09-256-43/+78
|\ | | | | | | | | | | | | 'origin/danielsilverstone/tarballs-instead-of-bundles' Reviewed-By: Lars Wirzenius (IRL) Reviewed-By: Richard Maw (IRL)
| * Use tarballs instead of bundlesDaniel Silverstone2012-09-256-43/+78
| | | | | | | | | | | | | | 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.
* | Catch URLError so that missing cache-servers don't cause morph to die.Daniel Silverstone2012-09-251-1/+1
|/ | | | Reviewed-By: Lars Wirzenius on IRC
* Merge branch 'master' of git://git.baserock.org/baserock/morphLars Wirzenius2012-09-251-3/+13
|\
| * Default bundle-server and cache-server based on trove-host.Daniel Silverstone2012-09-251-3/+13
| | | | | | | | | | | | | | This causes bundle-server and cache-server to be defaulted to appropriate Trove related URLs unless overridden in the configs. Reviewed-By: Lars Wirzenius <lars.wirzenius@codethink.co.uk>
* | Give Morph a version numberLars Wirzenius2012-09-251-0/+3
|/ | | | Reviewed-By: Daniel Silverstone (on irc)
* Lookup chunks within strata by 'morph' field, not 'name'Sam Thursfield2012-09-241-1/+1
| | | | | 'morph edit' is for editing source code, not built artifacts, so we should use the source morphology name.
* morph branch, checkout, edit: Print message when updating git cacheSam Thursfield2012-09-241-0/+2
| | | | | | | | This can take a long time if it's a big repo that has not been used before, so explain to the user what the command is doing, eg: ~:$ morph edit baserock:morphs foundation linux 2012-09-24 11:53:15 Updating git repository upstream:linux in cache
* Merge branch 'baserock/radiofree/check_mtime'Lars Wirzenius2012-09-241-0/+15
|\
| * Small coding standards/message fixesJames Thomas2012-09-211-2/+2
| |
| * Check the mtime of the app.py to make sure it is not in the futureJames Thomas2012-09-211-0/+15
| | | | | | | | If it's in the future this may cause problems, so exit with an error
* | Merge branch 'samthursfield/S4679-morph-petrify' of ↵Richard Maw2012-09-212-81/+149
|\ \ | |/ |/| | | git://git.baserock.org/baserock/morph
| * morph edit: unpetrify before editing, if need beSam Thursfield2012-09-211-0/+4
| | | | | | | | | | | | | | | | If the user explictly asks to edit a chunk, we can assume that they do not want it to be petrified any longer. Also, 'git clone -b' will fail if given a SHA1 instead of an actual ref.
| * morph petrify: Handle strata in external reposSam Thursfield2012-09-211-49/+52
| | | | | | | | | | | | This required factoring out some of the 'edit' command so we can use the same mechanism to make strata available to rewrite their refs for petrification.
| * Add 'morph unpetrify'Sam Thursfield2012-09-211-0/+44
| | | | | | | | Tested in the petrify test, to avoid duplication.
| * morph petrify: Rewrite in the style of todaySam Thursfield2012-09-212-36/+53
| |
| * morph foreach: Fix with cliapp < 1.20120630Sam Thursfield2012-09-211-9/+5
| | | | | | | | | | | | Use cliapp.Application.runcmd_unchecked() instead of runcmd() to get the full command output, without requiring AppException.msg (which is an inferior way to get the output in any case)
| * Always cache artifacts locally and report filenames during build.Daniel Silverstone2012-09-211-0/+7
| | | | | | | | | | | | | | | | | | | | | | The artifact being built is often subsequently hard to find since the user has to go digging around in their artifact cache to try and determine which artifact is the one they want. With this change, the filepath to the artifact will be displayed after building it. As a side effect, we also need to always cache artifacts locally in order to do this, otherwise we'd have to report URLs to the remote artifact cache instead and that might be less useful overall.
| * Add .artifact_filename() to external API of LocalArtifactCacheDaniel Silverstone2012-09-212-4/+13
| | | | | | | | | | | | This adds a way to access the local disk path of the artifact for an artifact. This is necessary to be able to report it to the user.
* | Give better error when reading a morphology file failsSam Thursfield2012-09-211-4/+9
| | | | | | | | | | | | | | | | Also remove a spurious warning. Longer term, this git access code should be moved to a Repo class which can be shared with the rest of Morph and provide more granular exceptions on failure.
* | Warn when we edit morphologies where filename != nameSam Thursfield2012-09-211-0/+4
| |
* | morph foreach: Mention -- in docstringSam Thursfield2012-09-211-0/+5
| | | | | | | | | | | | It's not obvious (to non-unix-beards) that -- should be used to pass commandline arguments, we should be careful to make it clear in the documentation.
* | Merge remote branch 'origin/samthursfield/S4872-fix-foreach-errors'Lars Wirzenius2012-09-211-9/+5
|\ \
| * | morph foreach: Fix with cliapp < 1.20120630Sam Thursfield2012-09-211-9/+5
| | | | | | | | | | | | | | | | | | Use cliapp.Application.runcmd_unchecked() instead of runcmd() to get the full command output, without requiring AppException.msg (which is an inferior way to get the output in any case)
* | | Merge branch 'master' of git://git.baserock.org/baserock/morphLars Wirzenius2012-09-213-4/+20
|\ \ \ | |_|/ |/| |
| * | Always cache artifacts locally and report filenames during build.Daniel Silverstone2012-09-211-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The artifact being built is often subsequently hard to find since the user has to go digging around in their artifact cache to try and determine which artifact is the one they want. With this change, the filepath to the artifact will be displayed after building it. As a side effect, we also need to always cache artifacts locally in order to do this, otherwise we'd have to report URLs to the remote artifact cache instead and that might be less useful overall.
| * | Add .artifact_filename() to external API of LocalArtifactCacheDaniel Silverstone2012-09-212-4/+13
| |/ | | | | | | | | | | This adds a way to access the local disk path of the artifact for an artifact. This is necessary to be able to report it to the user.
* | Refactor _fetch() and log bundle fetches.Daniel Silverstone2012-09-211-11/+18
|/ | | | | | 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.
* morph foreach: Use self.app.output.write(), not printSam Thursfield2012-09-181-2/+2
|
* Add 'morph foreach'Sam Thursfield2012-09-171-0/+43
| | | | | This is a useful tool for now to work around our lack of more specific system branch commands such as 'morph push' and 'morph pull'
* morph merge: Don't make a merge commit if only the refs changedSam Thursfield2012-09-142-3/+21
| | | | 'git commit' fails if there are no changes in any case.
* morph merge: Give full dir instead of repo name in merge errorsSam Thursfield2012-09-141-1/+1
| | | | | There are two copies of each repo involved at this point so we must be clear about which one has an error.
* morph merge: Merge changes in morphology contentsSam Thursfield2012-09-141-31/+76
| | | | | | | | | | | We now load the previous version of the morphology and check for differences, which allows us to handle components that were added or removed between branches. We currently disallow adding new chunks or strata in a branch if they were 'edit'ed afterwards. We can fix this by having 'edit' store the original ref in the repo, rather than reading it from the old version of the morphology.
* morph merge: Only update refs that were pointing at the 'from' branchSam Thursfield2012-09-141-3/+9
| | | | | | This fixes a major bug which would update all sorts of refs that should not have been updated. Also avoids rewriting morphs that haven't changed at all.
* morph edit: Be more permissive checking out repos for system branchesSam Thursfield2012-09-141-27/+36
| | | | | | | 'morph edit' will now restore a system branch ref if the user has accidentally deleted it. Includes refactoring to clear up parameter meanings.
* Update unit tests for bare repo caches.Daniel Silverstone2012-09-142-11/+31
| | | | Update the unit tests so that they pass with the new bare repository caches.
* Rework git caches to be bare mirrors of the repos.Daniel Silverstone2012-09-145-23/+107
| | | | | | | | 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.
* Merge branch 'samthursfield/lrc-error-improvements'Sam Thursfield2012-09-132-21/+28
|\ | | | | | | Reviewed-By: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
| * Give more useful errors when cloning from local cache failsSam Thursfield2012-09-132-21/+28
| |
* | Fix things so test suite works on Debian squeezeLars Wirzenius2012-09-132-36/+51
| | | | | | | | | | | | | | | | | | | | This requires disabling the feature that retains the original order of fields in a morphlogy when it gets overwritten. The implementation relies on features that are not available in Python 2.6. We need to support Morph on Debian squeeze, for bootstrapping purposes, and therefore need to have it work with Python 2.6. However, the morphology rewriting is only relevant for system branching and merging, and that isn't needed for bootstrapping, so we disable the affected tests on Python 2.6.
* | morph build: Use pre-v1.7.9 form of git commit-treeSam Thursfield2012-09-131-2/+2
|/ | | | | | This fixes 'morph build' and its tests on systems without git 1.7.9 (Morph worked fine on Baserock systems, but it also needs to run on Debian Squeeze so that we can bootstrap).