[MERGE] Add --no-checkout option to branch to create workingtree-less branches.
Michael Ellerman
michael at ellerman.id.au
Sat Jul 22 09:13:12 BST 2006
On Thu, 2006-07-06 at 09:16 -0500, John Arbash Meinel wrote:
> Michael Ellerman wrote:
> > Hi list,
> >
> > Add --no-checkout option to branch to create workingtree-less branches.
> >
> > This is useful in shared repositories when creating temporary branches,
> > the majority of the time spent branching is the creation of the working
> > tree. In some cases a working tree isn't necessary. Tests included.
> >
> > cheers
> >
>
> I think the first test is that a working tree shouldn't be created if
> the Repository has 'no-working-trees' flag set. Which seems to be the
> case on my end.
>
> What sort of temp branch are you creating, in a repo with working trees,
> such that you don't want a working tree? Just like a snapshot/tag/etc?
>
> I'm okay with the --no-checkout, but I want to pass None if it wasn't
> supplied by the user, so that it respects the Repositories default
> setting, rather than overriding it.
>
> Right now there is a bug in push, where if it is a local repository, it
> *always* creates the working tree. Even when the Repo says not to.
>
> ...
>
> > - if result_repo is None or result_repo.make_working_trees():
> > + if checkout and (result_repo is None or
> > + result_repo.make_working_trees()):
> > result.create_workingtree()
> > +
> > return result
>
> See, here you explicitly deny a checkout if repo says not to. But it
> seems like an argument passed into the command should override the
> default repository settings. So I would say something more like:
>
> if checkout is None:
> checkout = result_repo is None or result_repo.make_working_trees()
> if checkout:
> result.create_workingtree()
>
> But that means you can't use the 'not no_checkout' logic earlier.
>
> ...
>
> >
> > - def sprout(self, url, revision_id=None, basis=None):
> > + def sprout(self, url, revision_id=None, basis=None, checkout=True):
> > """See BzrDir.sprout()."""
> > from bzrlib.workingtree import WorkingTreeFormat2
> > self._make_tail(url)
> > @@ -747,8 +754,10 @@
> > self.open_branch().sprout(result, revision_id=revision_id)
> > except errors.NotBranchError:
> > pass
> > - # we always want a working tree
> > - WorkingTreeFormat2().initialize(result)
> > +
> > + if checkout:
> > + WorkingTreeFormat2().initialize(result)
> > +
> > return result
> >
I've just pushed a few fixes on my branch which I think address all your
comments.
http://michael.ellerman.id.au/bzr/branches/mpe
cheers
--
Michael Ellerman
IBM OzLabs
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)
We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060722/dd200428/attachment.pgp
More information about the bazaar
mailing list