Branches without working trees

Robert Collins robertc at robertcollins.net
Sun Oct 30 01:40:11 BST 2005


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.

> I also implemented "cmd_push" as a form of pull() with the targets
> reversed. To do this, I have pull() check to make sure that if there is
> a working tree, the branch is local.

I avoided this check by doing the split I mention above : my cmd_push
just opens (or creates) the branch.

> I also allow for a separate .bzr/x-push-target location. For some
> working models, you might have a default upstream, with a different
> default push location.

Some differences here - it didn't make sense to me that the push
location would be preserved by branching, so I stashed the push location
in ~/.bazaar/branches.conf. I plan to make policy prefixes cause the
branch name (i.e. the dir, or the manually set branch-name file
contents) combine with the push_location for a policy prefix (i.e. a
wildcard match in the config) to create a (hopefully) unique target.

> 
> This is getting pretty close to having branch aliases, which might be a
> better solution.
> 
> The doubt in my mind is why I made it a separate patch.

I think push is a must :). Right now, I'm working on making Aarons rsync
push decorate the cmd_push in bzr, so that both can be used. My cmd_push
is pushed to integration as I think its definately the right way -
though your working tree presence detection method may be useful in its
own right. I've also pushed a fix to bzrtools for the fallout from
changing diff to return 1 when there are changes.

Rob

-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051029/34c2df4e/attachment.pgp 


More information about the bazaar mailing list