WARNING: This server is unstable and will be retired in the next days. If you want to keep this forum available, please request immediately a migration on the Nabble Support forum. Forums that don't receive any migration request will be deleted forever.

[ANN] bzr-colo 0.0.1: colocated branches using present technology

View: New views
20 Messages — Rating Filter:   Alert me  
< Prev | 1 - 2 | Next >

[ANN] bzr-colo 0.0.1: colocated branches using present technology

by nmb (Bugzilla) :: Rate this Message:

| View Threaded | Show Only this Message

This is to announce the initial release of the bzr-colo plugin, which
supports the use of colocated branches using *existing* technologies in
Bazaar.  It is available at http://launchpad.net/bzr-colo or directly
from Bazaar with a ``bzr branch lp:bzr-colo ~/.bazaar/plugins/colo``.

The essential insight is that a directory specifier colo: can be used to
refer by name to branches stored in a .bzr/branches shared repository.
The remaining commands provide a user interface for working with these
hidden branches so that operations inside .bzr/branches are (almost
completely) unnecessary.

Jelmer Vernooij's bzr-colocated plugin provides a parallel
implementation of these ideas, by adding a new BzrDir format for branch
collections.  His plugin also supports "%" as a special character in
URLs to denote colocated branches, where this plugin uses the colo:
directory service.  When such formats appear in Bazaar's core, then the
bzr-colo plugin will be unnecessary.  However, for people using Bazaar
2.x, the bzr-colo plugin can provide the colocated branch workflow
without a software or disk format upgrade.

Matthew Fuller's Fascis concept
(http://wiki.bazaar.canonical.com/MatthewFuller/Fasces) also provided
important ideas for this plugin.  This plugin offers some of the
functionality suggested there using the concept of a colocated workspace
(==fascis).  One area of that functionality *not* implemented is that of
changing the default behavior of Bazaar commands.  This plugin
intentionally does not change existing commands, choosing instead to
include new functionality only in the colo-* commands.  This plugin will
only change existing commands once colocated branch functionality is in
Bazaar core.  The equivalencies between the colo-* commands and Bazaar's
builtin commands are straightforward.

Further thanks to Ian Clatworthy who first mentioned that a simple
plugin could augment possible future changes in Bazaar Explorer to work
with .bzr/branches and Stephen Turnbull who (unknowingly) prompted the
inclusion of the colo-clone command for creating a second working tree
for the same colocated workspace.


More about the plugin from the help:

In order to provide a faster and simpler working model, this plugin
tries to support a configuration similar to git and Mercurial's
colocated branches, where there is a single working tree that can be
switched between multiple branches that all co-exist in the same
directory.  This working model is entirely possible using Bazaar's
existing technology, and this plugin aims to make it as simple as
possible to use that model.

This plugin does not add any new formats or objects to Bazaar, it simply
provides convenience commands for working with a certain *convention*
for branch storage.  This plugin provides the following commands

     * colo-init
     * colo-branch
     * colo-branches
     * colo-fetch
     * colo-clone
     * colo-prune
     * colo-clean
     * colo-ify

For more information on working with this plugin, see ``bzr help
colo-tutorial`` and the help for the individual commands.

Referring to Colocated Branches
-------------------------------

This plugin adds a directory service of "colo:" that can be used to
refer to branches inside of the ``.bzr/branches`` directory.  So, for
example we could ``bzr switch colo:fix-eol-bug`` to do work in the
colocated ``fix-eol-bug`` branch.  Note that in some cases, the "colo:"
prefix is unnecessary because Bazaar automatically looks for branches in
the directory where the current branch is located.  So the previous
command would also work with ``bzr switch fix-eol-bug`` because switch
searches sibling directories automatically.

 From within a colocated workspace, the specifier ``colo:branch_name``
refers to the branch with that name in the current colocated workspace.
  It is possible to refer to colocated branches in *other* workspaces
using the syntax ``colo:workspace_location:branch_name``.  The
``workspace_location`` in this form can be either a path (e.g.
``colo:../other_project:trunk``) or a URL (e.g.
``colo:bzr+ssh://hostname/path/to/workspace:trunk``).

-Neil


Re: [ANN] bzr-colo 0.0.1: colocated branches using present technology

by Martin Pool-3 :: Rate this Message:

| View Threaded | Show Only this Message

That's very cool, and it's nice that this can be done as a plugin.
I'm trying it now.
--
Martin <http://launchpad.net/~mbp/>


Re: [ANN] bzr-colo 0.0.1: colocated branches using present technology

by Alexander Belchenko :: Rate this Message:

| View Threaded | Show Only this Message

Thanks. The name is a bit funny though ;-)



Re: [ANN] bzr-colo 0.0.1: colocated branches using present technology

by Alexander Belchenko :: Rate this Message:

| View Threaded | Show Only this Message

Neil Martinsen-Burrell пишет:

> This plugin does not add any new formats or objects to Bazaar, it simply
> provides convenience commands for working with a certain *convention*
> for branch storage.  This plugin provides the following commands
>
>     * colo-init
>     * colo-branch
>     * colo-branches
>     * colo-fetch
>     * colo-clone
>     * colo-prune
>     * colo-clean
>     * colo-ify

There is one more command required: to adjust the checkout location if
user move the colo branch on the filesystem. Because bzr uses absolute
path to master branch it's very necessary.

Also see https://bugs.launchpad.net/bugs/330086

> For more information on working with this plugin, see ``bzr help
> colo-tutorial`` and the help for the individual commands.

Why you put tutorial into python file? Why not use text file and
register help text as topic?



Re: [ANN] bzr-colo 0.0.1: colocated branches using present technology

by Alexander Belchenko :: Rate this Message:

| View Threaded | Show Only this Message

Neil Martinsen-Burrell пишет:
>  From within a colocated workspace, the specifier ``colo:branch_name``
> refers to the branch with that name in the current colocated workspace.
>  It is possible to refer to colocated branches in *other* workspaces
> using the syntax ``colo:workspace_location:branch_name``.  The
> ``workspace_location`` in this form can be either a path (e.g.
> ``colo:../other_project:trunk``) or a URL (e.g.
> ``colo:bzr+ssh://hostname/path/to/workspace:trunk``).

One question: does your plugin supports windows absolute paths? E.g.
colo:C:\work\repo\branch:trunk ?



Re: [ANN] bzr-colo 0.0.1: colocated branches using present technology

by Alexander Belchenko :: Rate this Message:

| View Threaded | Show Only this Message

I'm providing feedback as I go. I hope you don't bite me for this ;-)

Tutorial said:

"Just do ``bzr qlog .bzr/branches`` to see all of the
history for all of the branches in this colocated workspace."

Actually there is even simpler way: ``bzr qlog colo:``.



Re: [ANN] bzr-colo 0.0.1: colocated branches using present technology

by Aaron Bentley-4 :: Rate this Message:

| View Threaded | Show Only this Message

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alexander Belchenko wrote:
> There is one more command required: to adjust the checkout location if
> user move the colo branch on the filesystem.

I think switch --force would work for this.  Is there a reason why it
shouldn't?

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAktK8g8ACgkQ0F+nu1YWqI2q7gCfTjPVlsUIg7r5iWekqMeb3ei7
LkUAnA3bksxAjFo9Ja9ibsNxqjF30xZE
=ZUkl
-----END PGP SIGNATURE-----


Re: [ANN] bzr-colo 0.0.1: colocated branches using present technology

by Alexander Belchenko :: Rate this Message:

| View Threaded | Show Only this Message

Neil Martinsen-Burrell пишет:

>     * colo-clone

IIUC this command does not clone anything, it just creates new
lightweight checkout. In git IIRC the same achieved with `git checkout`.
I think `colo-clone` name is misleading (if not wrong). Clone means
create a copy, is it not?



Re: [ANN] bzr-colo 0.0.1: colocated branches using present technology

by Alexander Belchenko :: Rate this Message:

| View Threaded | Show Only this Message

Aaron Bentley пишет:
> Alexander Belchenko wrote:
>> There is one more command required: to adjust the checkout location if
>> user move the colo branch on the filesystem.
>
> I think switch --force would work for this.  Is there a reason why it
> shouldn't?

It requires to use /absolute/path/to/.bzr/branches/branch_name.
I think the plugin can provide a more easy and user-friendly way.
Is there any reason why it shouldn't?



Re: [ANN] bzr-colo 0.0.1: colocated branches using present technology

by Aaron Bentley-4 :: Rate this Message:

| View Threaded | Show Only this Message

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alexander Belchenko wrote:
> Aaron Bentley пишет:
>> Alexander Belchenko wrote:
>>> There is one more command required: to adjust the checkout location if
>>> user move the colo branch on the filesystem.
>>
>> I think switch --force would work for this.  Is there a reason why it
>> shouldn't?
>
> It requires to use /absolute/path/to/.bzr/branches/branch_name.

So one option would be extending the directory service to accommodate
this.  We could accept

colo:branch_name:/absolute/path/to

as an alternative way of referring to
/absolute/path/to/.bzr/branches/branch_name, for example.

> I think the plugin can provide a more easy and user-friendly way.
> Is there any reason why it shouldn't?

There are many reasons why adding a new command might not be the
approach, including:
- - The new command will increase user confusion by largely duplicating an
existing command
- - Work on the new command and the existing command will be divided,
resulting in two rough commands instead of one polished command
- - We'll miss the opportunity to make generalizations that can benefit
other commands.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAktLATkACgkQ0F+nu1YWqI3BdgCfe/DioOaolGsY0BfwA6q9l2k7
Ri4AnRvP7LKxYGs0xX+bkF/hqd5wnCIM
=LOk6
-----END PGP SIGNATURE-----


Re: [ANN] bzr-colo 0.0.1: colocated branches using present technology

by Alexander Belchenko :: Rate this Message:

| View Threaded | Show Only this Message

Aaron Bentley пишет:

> Alexander Belchenko wrote:
>> Aaron Bentley пишет:
>>> Alexander Belchenko wrote:
>>>> There is one more command required: to adjust the checkout location if
>>>> user move the colo branch on the filesystem.
>>> I think switch --force would work for this.  Is there a reason why it
>>> shouldn't?
>> It requires to use /absolute/path/to/.bzr/branches/branch_name.
>
> So one option would be extending the directory service to accommodate
> this.  We could accept
>
> colo:branch_name:/absolute/path/to
>
> as an alternative way of referring to
> /absolute/path/to/.bzr/branches/branch_name, for example.

According to colo documentation there is already such syntax:

colo:/absolute/path/to:branch_name

The problem is colo: service: it points to shared repository root based
on lightweight checkout location. But in the case of relocating the colo
entity the colo: will be broken as well, until the lightweight checkout
location will be fixed. And relative path there will fix the problem
auto-magically.

The problem with switch --force is that you have to remember actual
branch name. But if you don't remember it you have to look into
.bzr/branch/location file, but you have to know before where to look. If
you're not expert (of course, you Aaron *is* expert and maybe even
semigod) you're lost and will start tell everybody that moving colo
entity is horrible bad idea.

>> I think the plugin can provide a more easy and user-friendly way.
>> Is there any reason why it shouldn't?
>
> There are many reasons why adding a new command might not be the
> approach, including:
> - - The new command will increase user confusion by largely duplicating an
> existing command

Which one? `bzr switch --force colo:branch_name` simply won't work.

> - - Work on the new command and the existing command will be divided,
> resulting in two rough commands instead of one polished command

Which one should be polished? See my previous comment.

> - - We'll miss the opportunity to make generalizations that can benefit
> other commands.

I don't understand this. This plugin is not native solution. My
co-worker just told me that he won't use this plugin because it can't
pull/push all branches at once (as git can). Based on the already big
set of colo commands which duplicates existing bzr commands I see that
to support push/pull everything there should appear colo-pull and
colo-push, right?

That said I disagree with you.



Re: [ANN] bzr-colo 0.0.1: colocated branches using present technology

by nmb (Bugzilla) :: Rate this Message:

| View Threaded | Show Only this Message

On 2010-01-11 03:06 , Alexander Belchenko wrote:

> Neil Martinsen-Burrell пишет:
>> This plugin does not add any new formats or objects to Bazaar, it simply
>> provides convenience commands for working with a certain *convention*
>> for branch storage. This plugin provides the following commands
>>
>> * colo-init
>> * colo-branch
>> * colo-branches
>> * colo-fetch
>> * colo-clone
>> * colo-prune
>> * colo-clean
>> * colo-ify
>
> There is one more command required: to adjust the checkout location if
> user move the colo branch on the filesystem. Because bzr uses absolute
> path to master branch it's very necessary.
>
> Also see https://bugs.launchpad.net/bugs/330086

It's mentioned in the Tutorial under Limitations.  I suggest using ``bzr
switch --force`` there.  From the root of the checkout, you can use
relative paths ``bzr switch --force ./.bzr/branches/trunk``.

>> For more information on working with this plugin, see ``bzr help
>> colo-tutorial`` and the help for the individual commands.
>
> Why you put tutorial into python file? Why not use text file and
> register help text as topic?

Because I'd like my plugins to be installable with distutils and it's
easier to get a .py file installed than a .txt file.  Patches to use
package_data are welcome.

-Neil


Re: [ANN] bzr-colo 0.0.1: colocated branches using present technology

by Alexander Belchenko :: Rate this Message:

| View Threaded | Show Only this Message

Neil Martinsen-Burrell пишет:

> On 2010-01-11 03:06 , Alexander Belchenko wrote:
>> Neil Martinsen-Burrell пишет:
>>> This plugin does not add any new formats or objects to Bazaar, it simply
>>> provides convenience commands for working with a certain *convention*
>>> for branch storage. This plugin provides the following commands
>>>
>>> * colo-init
>>> * colo-branch
>>> * colo-branches
>>> * colo-fetch
>>> * colo-clone
>>> * colo-prune
>>> * colo-clean
>>> * colo-ify
>>
>> There is one more command required: to adjust the checkout location if
>> user move the colo branch on the filesystem. Because bzr uses absolute
>> path to master branch it's very necessary.
>>
>> Also see https://bugs.launchpad.net/bugs/330086
>
> It's mentioned in the Tutorial under Limitations.  I suggest using ``bzr
> switch --force`` there.  From the root of the checkout, you can use
> relative paths ``bzr switch --force ./.bzr/branches/trunk``.

It seems you and Aaron missed my point.

What if I want just update the lightweight checkout reference without switch to trunk?
And my current branch is not trunk?
And I don't remember which branch is current?
And I have ten branches inside .bzr/branches?

How can I know what I should switch --force?



Re: [ANN] bzr-colo 0.0.1: colocated branches using present technology

by pickscrape :: Rate this Message:

| View Threaded | Show Only this Message

On Sunday 10 January 2010 09:35:51 pm Neil Martinsen-Burrell wrote:
> This is to announce the initial release of the bzr-colo plugin, which
> supports the use of colocated branches using *existing* technologies in
> Bazaar.  It is available at http://launchpad.net/bzr-colo or directly
> from Bazaar with a ``bzr branch lp:bzr-colo ~/.bazaar/plugins/colo``.
>

Hi,

This is really interesting stuff, and I'm having a play to see if it could fit
in with our workflow (as an option to our developers: I for one would
certainly be interested in trying it). However, I am seeing a problem relating
to switch and bound branches. This is a problem that I've also seen without
colocated branches too, so it may be a bug in core bzr itself. Either way, I'm
going to demonstrate it here in order to get some feedback.

Our workflow consists entirely of bound branches, as we like to have our work
on our central server to allow everyone to see what everyone else is doing. So
we all have a shared repository with X bound branches within it (these are
heavyweight too). Some developers switch between branches using a symlink,
while others (such as myself) use a single lightweight checkout and switch
using that. You can see at this point how colocated branches could fit in
nicely with the switch-based workflow. :)

Anyway, without getting into co-located branches yet, this demonstrates the
switch problem I mentioned earlier (I'm running bzr 2.0.3):

# Create a "remote" repository with a trunk and a branch
~/test$ bzr init-repo remote
~/test$ cd remote          
~/test/remote$ bzr init trunk
Created a repository tree (format: 2a)                                                                                                                  
Using shared repository: /home/rbrown/test/remote/                                                                                                      
~/test/remote$ bzr branch trunk branch1
Branched 0 revision(s).                                                                                                                                  
~/test/remote$ cd ../

# Create local layout
~/test$ bzr init-repo local
~/test$ cd local
~/test/local$ bzr co ../remote/trunk
~/test/local$ bzr co ../remote/branch1
~/test/local$ bzr co --lightweight trunk switch

# Now see what bzr thinks of the switch branch
~/test/local$ cd switch
$ bzr info
Lightweight checkout (format: 2a or development-subtree)
Location:
       light checkout root: .
  repository checkout root: /home/rbrown/test/local/trunk
        checkout of branch: /home/rbrown/test/remote/trunk
         shared repository: /home/rbrown/test/local

So switch is a lightweight checkout of (local) trunk, which is a remote
checkout of remote trunk. This works beautifully: if I commit in switch, both
the local and remote version of the branch get updated (the working trees
don't, but that isn't a problem).

# Switch to branch1
~/test/local/switch$ bzr switch ../branch1
Updated to revision 0.
Switched to branch: /home/rbrown/test/local/branch1/
~/test/local/switch$ bzr info
Lightweight checkout (format: 2a or development-subtree)
Location:
       light checkout root: .
  repository checkout root: /home/rbrown/test/local/branch1
        checkout of branch: /home/rbrown/test/remote/branch1
         shared repository: /home/rbrown/test/local

Same result, but notice that I switched using a relative path rather than
simply the branch name, which switch supports. Look what happens now when I
switch by just specifying the branch name:

~/test/local/switch$ bzr switch trunk
Updated to revision 0.
Switched to branch: /home/rbrown/test/remote/trunk/
~/test/local/switch$ bzr info
Lightweight checkout (format: 2a or development-subtree)
Location:
  light checkout root: .
   checkout of branch: /home/rbrown/test/remote/trunk
    shared repository: /home/rbrown/test/remote

Oops, my local branch has now been bypassed and switch has become a
lightweight checkout of the remote branch. The result is that operations
within switch are as slow as could be when the remote branch is somewhere
across the WAN (which in my case it is in the real world).

So that's the crux of my problem: why do these two produce different results,
and should they?

bzr switch trunk
bzr switch ../trunk

So anyway, back to colocated branches. Taking the same example remote
repository, let's try using colo:

~/test$ bzr colo-init colo
Shared repository (format: 2a)          
Location:                              
  shared repository: colo/.bzr/branches
Created a repository branch (format: 2a)
Using shared repository: /home/rbrown/test/colo/.bzr/branches/
~/test$ cd colo                                                                                                                            

# We're on trunk: bind it to the remote trunk
~/test/colo$ bzr bind ../remote/trunk                                                                                                      
~/test/colo$ bzr info                                                                                                                      
Lightweight checkout (format: 2a or development-subtree)                                                                                                
Location:                                                                                                                                                
       light checkout root: .                                                                                                                            
  repository checkout root: .bzr/branches/trunk                                                                                                          
        checkout of branch: /home/rbrown/test/remote/trunk                                                                                              
         shared repository: .bzr/branches                                                                                                                

# All good, now we want branch1.
~/test/colo$ bzr branch ../remote/branch1 colo:branch1                                                                                    
Branched 0 revision(s).                                                                                                                                  
~/test/colo$ bzr switch colo:branch1                                                                                                      
Tree is up to date at revision 0.                                                                                                                        
Switched to branch: /home/rbrown/test/colo/.bzr/branches/branch1/                                                                                        
~/test/colo$ bzr bind ../remote/branch1
~/test/colo$ bzr info
Lightweight checkout (format: 2a or development-subtree)
Location:
       light checkout root: .
  repository checkout root: .bzr/branches/branch1
        checkout of branch: /home/rbrown/test/remote/branch1
         shared repository: .bzr/branches

Related branches:
  parent branch: /home/rbrown/test/remote/branch1

Exactly as expected, though I think this workflow is missing either a checkout
equivalent command or branch --bind. But moving on...

# Try switching between branches
~/test/colo$ bzr switch colo:trunk
Tree is up to date at revision 0.
Switched to branch: /home/rbrown/test/colo/.bzr/branches/trunk/
~/test/colo$ bzr info
Lightweight checkout (format: 2a or development-subtree)
Location:
       light checkout root: .
  repository checkout root: .bzr/branches/trunk
        checkout of branch: /home/rbrown/test/remote/trunk
         shared repository: .bzr/branches
~/test/colo$ bzr switch colo:branch1
Tree is up to date at revision 0.
Switched to branch: /home/rbrown/test/colo/.bzr/branches/branch1/
~/test/colo$ bzr info
Lightweight checkout (format: 2a or development-subtree)
Location:
       light checkout root: .
  repository checkout root: .bzr/branches/branch1
        checkout of branch: /home/rbrown/test/remote/branch1
         shared repository: .bzr/branches

Related branches:
  parent branch: /home/rbrown/test/remote/branch1

# All perfect so far! Now try using switch's shortcut and don't prefix with
colo:
~/test/colo$ bzr switch trunk
Updated to revision 0.
Switched to branch: /home/rbrown/test/remote/trunk/
~/test/colo$ bzr info
Lightweight checkout (format: 2a or development-subtree)
Location:
  light checkout root: .
   checkout of branch: /home/rbrown/test/remote/trunk
    shared repository: /home/rbrown/test/remote

Oops, there it goes deleting the link to the colocated branch! The checkout is
now completely connected to the remote repository and doesn't involve the
colocated branch at all. Look what happens when I try to switch back to
branch1 now:

~/test/colo$ bzr switch branch1
Updated to revision 0.
Switched to branch: /home/rbrown/test/remote/branch1/
~/test/colo$ bzr info
Lightweight checkout (format: 2a or development-subtree)
Location:
  light checkout root: .
   checkout of branch: /home/rbrown/test/remote/branch1
    shared repository: /home/rbrown/test/remote

Related branches:
  parent branch: /home/rbrown/test/remote/trunk
  submit branch: /home/rbrown/test/remote/branch1

Still connecting directly to remote... What happens if I specify colo:?

~/test/colo$ bzr switch colo:trunk
bzr: ERROR: Invalid url supplied to transport: "colo:trunk": Not in a
colocated workspace

Oh dear, it looks like it's basically broken now. I'm not entirely sure what
I'd need to do to go about rescuing this colo now...

As I say, I think that this is a core bzr problem rather than a problem with
colo per se, and I think this plugin is really interesting and is something
that I look forward to in the future.

Should I raise a bug about this switch problem, or is it intended behaviour?

Thanks.

--

Russ


Re: [ANN] bzr-colo 0.0.1: colocated branches using present technology

by John Arbash Meinel :: Rate this Message:

| View Threaded | Show Only this Message

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


...

> Oops, my local branch has now been bypassed and switch has become a
> lightweight checkout of the remote branch. The result is that operations
> within switch are as slow as could be when the remote branch is somewhere
> across the WAN (which in my case it is in the real world).
>
> So that's the crux of my problem: why do these two produce different results,
> and should they?
>
> bzr switch trunk
> bzr switch ../trunk
>

It is because of how the 'trunk' short name is getting looked up. If you
look at bzrlib.builtins.cmd_switch._get_branch_location

It first checks to see if this is a bound branch, before checking if it
is a branch reference. And use the master location as the base for
determining the relative path.

Which is inconsistent with bzrlib.switch._set_branch_location, which
first checks to see if this is a lightweight checkout before checking to
see if it has a master branch.

Probably "just a bug" and we should switch _get_branch_location to check
for a lightweight checkout first.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAktLqSsACgkQJdeBCYSNAAMUsACgjo43r4VfGCs+xaUnL+YDvpJi
Y5wAoKy0DPQj8hFW5vgIfe70aigZqtd6
=AHcR
-----END PGP SIGNATURE-----


Re: [ANN] bzr-colo 0.0.1: colocated branches using present technology

by pickscrape :: Rate this Message:

| View Threaded | Show Only this Message

On Monday 11 January 2010 04:41:47 pm you wrote:
> Probably "just a bug" and we should switch _get_branch_location to check
> for a lightweight checkout first.
>

Thanks John, I've raised the following bug accordingly:

https://bugs.launchpad.net/bzr/+bug/506177

--

Russ


Re: [ANN] bzr-colo 0.0.1: colocated branches using present technology

by nmb (Bugzilla) :: Rate this Message:

| View Threaded | Show Only this Message

On 2010-01-11 14:37 , Alexander Belchenko wrote:

> Neil Martinsen-Burrell пишет:
>> On 2010-01-11 03:06 , Alexander Belchenko wrote:
>>> Neil Martinsen-Burrell пишет:
>>>> This plugin does not add any new formats or objects to Bazaar, it
>>>> simply
>>>> provides convenience commands for working with a certain *convention*
>>>> for branch storage. This plugin provides the following commands
>>>>
>>>> * colo-init
>>>> * colo-branch
>>>> * colo-branches
>>>> * colo-fetch
>>>> * colo-clone
>>>> * colo-prune
>>>> * colo-clean
>>>> * colo-ify
>>>
>>> There is one more command required: to adjust the checkout location if
>>> user move the colo branch on the filesystem. Because bzr uses absolute
>>> path to master branch it's very necessary.
>>>
>>> Also see https://bugs.launchpad.net/bugs/330086
>>
>> It's mentioned in the Tutorial under Limitations. I suggest using
>> ``bzr switch --force`` there. From the root of the checkout, you can
>> use relative paths ``bzr switch --force ./.bzr/branches/trunk``.
>
> It seems you and Aaron missed my point.
>
> What if I want just update the lightweight checkout reference without
> switch to trunk?

You can update the lightweight checkout reference to any branch you want
inside .bzr/branches

> And my current branch is not trunk?

Just ``bzr switch --force .bzr/branches/other-branch``.

> And I don't remember which branch is current?
 > And I have ten branches inside .bzr/branches?
 >
 > How can I know what I should switch --force?

This is trickier.  Then, we need to infer from the current (incorrect)
content of .bzr/branch/location what the current branch name should be.
  (Hmm. This shouldn't be too hard since .bzr/branches will most likely
only occur once in the path inside .bzr/branch/location.  Then we can
just figure out the mapping between . and the rest of the path there.)
Could you file a bug on bzr-colo about this?  It probably does need a
new command ``colo-fixup`` that uses knowledge of the particular
structure at work her to reconnect things.

-Neil


Re: [ANN] bzr-colo 0.0.1: colocated branches using present technology

by nmb (Bugzilla) :: Rate this Message:

| View Threaded | Show Only this Message

On 2010-01-11 16:19 , Russ Brown wrote:

[...great bug reporting snipped...]

> # All perfect so far! Now try using switch's shortcut and don't prefix with
> colo:
> ~/test/colo$ bzr switch trunk
> Updated to revision 0.
> Switched to branch: /home/rbrown/test/remote/trunk/
> ~/test/colo$ bzr info
> Lightweight checkout (format: 2a or development-subtree)
> Location:
>    light checkout root: .
>     checkout of branch: /home/rbrown/test/remote/trunk
>      shared repository: /home/rbrown/test/remote
>
> Oops, there it goes deleting the link to the colocated branch! The checkout is
> now completely connected to the remote repository and doesn't involve the
> colocated branch at all. Look what happens when I try to switch back to
> branch1 now:
>
> ~/test/colo$ bzr switch branch1
> Updated to revision 0.
> Switched to branch: /home/rbrown/test/remote/branch1/
> ~/test/colo$ bzr info
> Lightweight checkout (format: 2a or development-subtree)
> Location:
>    light checkout root: .
>     checkout of branch: /home/rbrown/test/remote/branch1
>      shared repository: /home/rbrown/test/remote
>
> Related branches:
>    parent branch: /home/rbrown/test/remote/trunk
>    submit branch: /home/rbrown/test/remote/branch1
>
> Still connecting directly to remote... What happens if I specify colo:?
>
> ~/test/colo$ bzr switch colo:trunk
> bzr: ERROR: Invalid url supplied to transport: "colo:trunk": Not in a
> colocated workspace
>
> Oh dear, it looks like it's basically broken now. I'm not entirely sure what
> I'd need to do to go about rescuing this colo now...

A colocated workspace is fundamentally about the checkout.  It uses the
checkout to look up the branches that live in the hidden shared
repository in .bzr/branches.  When it gets switched to a branch that is
not in that shared repository, it can't find those branches again.  The
solution is to force the checkout to switch back to a branch that you
*know* is in the shared repository, so ``bzr switch --force
.bzr/branches/trunk`` from the root directory of the checkout should
"rescue" it.

> As I say, I think that this is a core bzr problem rather than a problem with
> colo per se, and I think this plugin is really interesting and is something
> that I look forward to in the future.

I'll think about how to make the current colo structure more robust to
this type of issue.  (It's also a problem when moving the colocated
workspace around on disk since Bazaar uses absolute paths to reference
branches from checkouts.)

-Neil


Re: [ANN] bzr-colo 0.0.1: colocated branches using present technology

by Ian Clatworthy-2 :: Rate this Message:

| View Threaded | Show Only this Message

Neil Martinsen-Burrell wrote:

> I'll think about how to make the current colo structure more robust to
> this type of issue.  (It's also a problem when moving the colocated
> workspace around on disk since Bazaar uses absolute paths to reference
> branches from checkouts.)

Being able to move or rename a checkout with an embedded shared
repository is a pretty important feature IMO.

Can you submit to patch to core bzr to address that? It would be fine
IMO if relative paths were stored in the case where the branch path is
inside the checkout path.

Ian C.


Re: [ANN] bzr-colo 0.0.1: colocated branches using present technology

by Alexander Belchenko :: Rate this Message:

| View Threaded | Show Only this Message

Neil Martinsen-Burrell пишет:

> On 2010-01-11 14:37 , Alexander Belchenko wrote:
>> Neil Martinsen-Burrell пишет:
>>> On 2010-01-11 03:06 , Alexander Belchenko wrote:
>>>> Neil Martinsen-Burrell пишет:
>>>>> This plugin does not add any new formats or objects to Bazaar, it
>>>>> simply
>>>>> provides convenience commands for working with a certain *convention*
>>>>> for branch storage. This plugin provides the following commands
>>>>>
>>>>> * colo-init
>>>>> * colo-branch
>>>>> * colo-branches
>>>>> * colo-fetch
>>>>> * colo-clone
>>>>> * colo-prune
>>>>> * colo-clean
>>>>> * colo-ify
>>>>
>>>> There is one more command required: to adjust the checkout location if
>>>> user move the colo branch on the filesystem. Because bzr uses absolute
>>>> path to master branch it's very necessary.
>>>>
>>>> Also see https://bugs.launchpad.net/bugs/330086
>>>
>>> It's mentioned in the Tutorial under Limitations. I suggest using
>>> ``bzr switch --force`` there. From the root of the checkout, you can
>>> use relative paths ``bzr switch --force ./.bzr/branches/trunk``.
>>
>> It seems you and Aaron missed my point.
>>
>> What if I want just update the lightweight checkout reference without
>> switch to trunk?
>
> You can update the lightweight checkout reference to any branch you want
> inside .bzr/branches

I know, thanks.

>
>> And my current branch is not trunk?
>
> Just ``bzr switch --force .bzr/branches/other-branch``.

I know this too, thanks.

>> And I don't remember which branch is current?
>  > And I have ten branches inside .bzr/branches?
>  >
>  > How can I know what I should switch --force?
>
> This is trickier.  Then, we need to infer from the current (incorrect)
> content of .bzr/branch/location what the current branch name should be.
>  (Hmm. This shouldn't be too hard since .bzr/branches will most likely
> only occur once in the path inside .bzr/branch/location.  Then we can
> just figure out the mapping between . and the rest of the path there.)
> Could you file a bug on bzr-colo about this?  It probably does need a
> new command ``colo-fixup`` that uses knowledge of the particular
> structure at work her to reconnect things.

Finally we reached the core of the problem. I'll file a bug.
Yesterday I've tried to write some patch to address this problem, but it becomes a bit tricky
because there is no straightforward way in bzrlib to manipulate with branch references.


< Prev | 1 - 2 | Next >