Branches without working trees
John A Meinel
john at arbash-meinel.com
Sun Oct 30 03:19:45 GMT 2005
Robert Collins wrote:
> On Sat, 2005-10-29 at 16:02 -0500, John A Meinel wrote:
>> Attached is a patch which allows for branches which do not have a
>> working tree. It is also available as a branch here:
>> http://bzr.arbash-meinel.com/branches/bzr/no-working-tree/
>>
>> I think this makes sense for published repositories.
>
> I agree, so much so in fact, that I did almost exactly the same thing in
> my branch today too. From my NEWS file:
>
> IMPROVEMENTS:
>
> * 'bzr diff' now returns 1 when there are changes in the working
> tree.
>
> * 'bzr push' now exists and can push changes to a remote location.
> This uses the transport infrastructure, and can store the remote
> location in the ~/.bazaar/branches.conf configuration file.
>
> INTERNALS:
>
> * WorkingTree.pull has been split across Branch and WorkingTree,
> to allow Branch only pulls.
>
> * commands.display_command now returns the result of the decorated
> function.
>
> * LocationConfig now has a set_user_option(key, value) call to save
> a setting in its matching location section (a new one is created
> if needed).
>
> * Branch has two new methods, get_push_location and
> set_push_location
> to respectively, get and set the push location.
>
>
>> This means I moved "WorkingTree.pull()" back into Branch.
>
> I split this instead - workingtree responsibilities stayed on the tree,
> branch ones moved to the branch.
Some comments on your changes:
In cmd_pull() you set the parent *before* you connect to the remote
branch. Which means if there is a typo in the command, it will remember
a bad branch name. I think it would be better to do it after a
successful pull, as it used to do.
In my version of push, it would test to see if it was possible to update
the working tree (or if one did not exist).
This meant that you could push to a network share, or just to another
branch on the same machine, and it would still update the working
directory. I think this is useful, rather than just outright forbidding it.
One problem with not updating the working tree is that we currently have
no way of doing it correctly.
"bzr revert" will change the working tree into the last revision, which
is close to correct, but if there were any uncommitted changes, they
would be lost (and you can't just commit, because that would revert all
of the other changes). The best you could do is a "bzr diff -r ???"
where you have to remember what ??? the tree was before it was pushed into.
I'm not sure that "bzr push" should create the remote directory if it
doesn't exist. Maybe. It can be nice as a first step for publishing
things. But it also means a typo could go wrong. Perhaps it could do it
if you supply a flag. "bzr push --create".
It looks like you merged in the diff changes, as well as the
set_user_option changes all into one patch. Not a big deal, but its nice
when changes are focused on a single change.
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/20051029/47c079ba/attachment.pgp
More information about the bazaar
mailing list