How to store binaries along tree

Anteru newsgroups at catchall.shelter13.net
Wed May 4 19:32:20 UTC 2011


That looks indeed helpful. Is there an easy way to run a Python script
on the client side after a pull (preferably from the repository side?)
This would allow me to make all of this straightforward for the user.

It seems easy enough to do it manually, and with some client-side
plumbing I can automate it to the point where the user just needs to run
a script after pull, but it would be definitely cool if that script
could be run automatically when pulling new revisions.

Cheers,
  Anteru

Am 04.05.2011 09:03, schrieb John Arbash Meinel:
> On 5/3/2011 10:17 PM, Anteru wrote:
>> Hi,
> 
> 
> ...
> 
>> Is there a way to have one subfolder of the source code repository
>> branch being linked to another repository, doing a lightweight checkout
>> there? I.e. having a /bin subfolder which pulls in from another Bazaar
>> repository? If it's not possible with Bazaar, could it be made to work
>> with SVN for instance? Alternatively: Could we add a repository hook
>> which gets executed on the client side using the Bazaar Python runtime?
>> This would allow us to manually hack this in (even though I would like
>> to avoid the last solution, as we would wind up with Python 2.x code
>> while the rest of our codebase is Python 3.2, but it should be pretty
>> limited/self-contained.)
> 
>> Cheers,
>>   Anteru
> 
> 
> 
> You can always have a subdirectory pointing at a different repository,
> and it can be a lightweight checkout rather than a full branch if you
> want to avoid having a local copy of the history. I think the biggest
> part is how you want this subdirectory to be managed wrt the containing
> directory. If you are okay with doing manual updates, then there
> shouldn't be any problems, nor need any extra functionality.
> 
> This is how I would set it up from scratch:
> 
> $work => a directory containing all files, including 'bin/'
> $server => the central location for your files, something like:
> 	bzr+ssh://host/srv/bzr
> 
> cd $work
> bzr init
> # You won't be versioning "bin" in the outer directory, so ignore it
> bzr ignore ./bin
> bzr add
> bzr commit -m "Initial import"
> bzr init-repo --no-trees $server/repo/
> bzr push $server/repo/trunk
> 
> cd bin
> bzr init
> bzr add
> bzr commit -m "Initial import of binaries"
> bzr init-repo --no-trees $server/repo-bin
> bzr push $server/repo-bin/trunk
> 
> # Now change the bin directory to be a lightweight checkout
> # I don't know of a trivial way to do it without re-creating the
> # directory, though the bzr data model would allow it, just isn't
> # exposed. If it is an issue, I can work through it with you.
> cd ..
> rm -rf bin
> bzr co --lightweight $server/repo-bin/trunk bin
> 
> 
> At this point, you now have a full history branch+repository at $work,
> and a separate lightweight checkout at $work/bin. When you want newer
> binary files you can do:
>  cd bin
>  bzr up
> 
> There are more things I would tweak if you have a large project, etc.
> But this was meant as a way to show how I would set up your specific
> request. (I want to version large files in a separate repository, and
> avoid having a local copy of history.)
> 
> Note that you can still create branches of bin and switch between it.
> Just you would probably want to do that on the server side. So something
> like:
> 
>  cd $work/bin
>  bzr branch --switch $server/repo-bin/trunk $server/repo-bin/feature
>  # alternatively, though it is fairly context sensitive, and always
>  # branches from the 'current' branch to the new branch name, rather
>  # than starting from a clean trunk each time:
>  bzr switch -b feature
> 
> John
> =:->




More information about the bazaar mailing list