Cached files [was Re: Inner repos]
John A Meinel
john at arbash-meinel.com
Sat Dec 31 18:08:28 GMT 2005
Marco Canini wrote:
> Well, it seems that I should be fine with your rsync plugin.
> Though I don't understand in which order I should run the rpush, push or the
> rpull, pull commands, and how they differ.
> It would be cool to have both rsync add / remove commands instead of editing
> the file by hand.
>
> Many thanks John
>
Here is the rundown:
bzr pull
Reads the remote Branch, and figures out what to pull into the
local branch. Then it does a merge to update the local working
tree. So local changes are preserved, and only committed changes
are pulled across.
bzr rpull
Just a fancy invocation of 'rsync'. The main advantage of using
rpull over rsync REMOTE LOCAL, is that it knows a little bit
more about what files are precious and what files are not.
It will also pay attention to the *local* .bzrignore and .rsync*
files.
This means that if your remote tree is not pristine in any way
you will get those artifacts locally.
This basically just gives you a near-exact copy of the remote
tree. So if the remote tree is out of date, or modified, or
anything, so will your local tree afterwards.
Local uncommitted changes will be lost. Local committed changes
will also be lost if you use --force.
bzr push
Basically acts like "bzr pull" only in reverse. Meaning it will
install only committed changes. If both branches are local, it
will also try to update the working tree.
bzr rpush
An even more exact remote copy. Because remote trees are
relatively inaccessible, it will do extra work to keep them
pristine. This includes deleting files that it doesn't know
about. (So if you have a remote .pyc it will probably delete it)
One other caveat, bzr rpush and rpull expect you to also set the
.bzr/parent file in order to have any sort of safety. They use
.bzr/x-rsync-data to figure out what tree to invoke rsync on, but use
.bzr/parent to see if they are out of date.
They are not shared, because they are different paths. (In my case I
have a parent of http://bzr.arbash-meinel.com/plugins/rsync, but a
x-rsync-data of juju.arbash-meinel.com:/srv/bzr/public/plugins/rsync)
The reason is that you can check for out of date over http/sftp, but you
rsync using the rsync program. bzrtools' push is a little bit fancier,
in that it will run rsync to download the remote revision-history in
order to check for diverged branches.
I hope I haven't thoroughly confused you. :)
As far as rsync add/remove commands,
.bzrignore/.rsyncexclude/.rsyncinclude are all wildcard patterns. It
isn't quite as simple as add/remove. And you have to worry about
precedence (.rsyncinclude comes before .rsyncexclude comes before
.bzrignore).
It is mildly complex, and difficult to just do the right thing,
especially with wildcards. Trying to figure out what file needs to be
updated is pretty tricky. Though not terrible for a human to figure out.
But certainly the rsync plugin could be updated to include commands for
'rinclude' and 'rexclude'. Though these are effectively just "echo ARGS
>> .rsyncinclude" and "echo ARGS >> .rsyncexclude". For removing a
previously added, it would have to read the file, and delete a pattern.
Which is much better done by a human.
John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051231/05770ded/attachment.pgp
More information about the bazaar
mailing list