diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2012-07-31 16:30:52 +0000 |
---|---|---|
committer | Richard Maw <richard.maw@codethink.co.uk> | 2012-08-01 13:28:10 +0000 |
commit | dabe86700200c529846927230e5e97249bf70792 (patch) | |
tree | 67647b2c4d6bf14b0110a62178553f80d6104970 /morphlib/app.py | |
parent | 9370ccddabbbe89120710732d9029e61f3c97cb8 (diff) | |
download | morph-dabe86700200c529846927230e5e97249bf70792.tar.gz |
Move command petrify to branch_and_merge plugin
This does not require any other function movements, due to its
simple implementation.
Diffstat (limited to 'morphlib/app.py')
-rwxr-xr-x | morphlib/app.py | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/morphlib/app.py b/morphlib/app.py index dbcf2c2b..80cd20e3 100755 --- a/morphlib/app.py +++ b/morphlib/app.py @@ -748,41 +748,6 @@ class Morph(cliapp.Application): repo_dir = os.path.join(mine, this_branch, basename) self.runcmd(['git', 'pull', pull_from, other_branch], cwd=repo_dir) - def cmd_petrify(self, args): - '''Make refs to chunks be absolute SHA-1s.''' - - if not os.path.exists(self.settings['cachedir']): - os.mkdir(self.settings['cachedir']) - cachedir = os.path.join(self.settings['cachedir'], 'gits') - repo_resolver = morphlib.repoaliasresolver.RepoAliasResolver( - self.settings['repo-alias']) - bundle_base_url = self.settings['bundle-server'] - cache = morphlib.localrepocache.LocalRepoCache( - self, cachedir, repo_resolver, bundle_base_url) - - for filename in args: - with open(filename) as f: - morph = json.load(f) - - if morph['kind'] != 'stratum': - self.status(msg='Not a stratum: %(filename)s', - filename=filename) - continue - - self.status(msg='Petrifying %(filename)s', filename=filename) - - for source in morph['sources']: - reponame = source.get('repo', source['name']) - ref = source['ref'] - self.status(msg='Looking up sha1 for %(repo_name)s %(ref)s', - repo_name=reponame, - ref=ref) - repo = cache.get_repo(reponame) - source['ref'] = repo.resolve_ref(ref) - - with open(filename, 'w') as f: - json.dump(morph, f, indent=2) - def status(self, **kwargs): '''Show user a status update. |