Peter, sorry for not answering sooner ... I keep an eye out for posts with Metacello in the subject line so I missed this one ...

So if i understand your question, you have a GitHub project that you normally download like this:

  Metacello new
    baseline: 'Sample';
    repository: 'github://GsDevKit/sampleProject:master/repository';
    load.

now you have cloned the repository to a local git repository:

  cd /opt/git
  git clone g...@github.com:GsDevKit/sampleProject.git

and you can directly load the project like this:

  Metacello new
    baseline: 'Sample';
    repository: 'filetree:'///opt/git/sampleProject/repository';
    load.

but in another configuration (that you may not control) there is dependency upon Sample that looks like this:

spec baseline: 'Sample' with: [ spec repository: 'github://GsDevKit/sampleProject:master/repository' ].

and you are wondering how you can force you local clone to be used ... is that correct?

If so then the trick is to use the Metacello `lock` ... Do the following BEFORE loading the project that depends upon you sample project:

  Metacello new
    baseline: 'Sample';
    repository: 'filetree:'///opt/git/sampleProject/repository';
    lock.

Then whenever Metacello finds a dependency upon 'Sample' the local clone (the `lock`ed) project will be used instead.

This is use case is the primary reason for the existence of the `lock` command. Also note that you need to use the scripting api for all loads to make sure that the lock is honored. Finally you can use the onLock: message to break the lock in certain cases ... the default Metacello load honors all locks (a Warning is dumped to the transcript) ...

As Thierry mentions, you should be using the latest version of Metacello on github ...

If I missed the mark here let know ...

Dale



On 3/21/15 6:41 AM, Peter Uhnák wrote:
Hi,

I'm trying to load local package over git one...
basically:

Projects A and B.
A depends on B.
A loads B from its BaselineOfA, the reference points to github.

Now I have also local copy of B git repository, and I would like to
either
a) Override the load of B with local B (so the packages will point to local instead of remote). Currently it fails on MetacelloRepositorySpec>>hasNoLoadConflicts: because each (local and git) repo points to different place. This would be useful if I want to make change to B AFTER the project B is already loaded.

b) Add all packages from B to local B repo (same as manually using "add to package..." in Monticello Browser") This will work only if both the repos have the same packages, so probably not that useful. (i.e. no code differences)

c) Override the GitHub B repository in the BaselineOfA BEFORE the project is loaded. This would require some mapping in Monticello browser, I've seen something like "repositoryOverrides:" but I don't know how it works. This would be useful if I knew beforehand that I want to make changes also to B.

So how would one go about this? Having option "c)" would be probably the best; I can live without "a)". :)

Any pointers appreciated,
Peter


Reply via email to